I am novice in Javascript and i want to test a website using JavaScript. My Javascript file has two function Login and Some Function
Here, Some Function has space in between and i want to call this function via npm run command.
File somefile.js
module.exports = {
"Login": function (browser) {
console.log("Hi --> Pawan");
},
"Some Function": function (browser) {
console.log("Some Script data");
}
};
File package.json
{
"name": "sampletest",
"version": "1.0.0",
"description": "",
"main": "somefile.js",
"scripts": {
"loginScript": "node -e \"require('./someFile').Login()\"",
"somefuncScript": "node -e \"require('./someFile').\"Some Function()\"\""
},
"author": "",
"license": "ISC"
}
Commands used are :-
npm run loginScript returns Hi --> Pawan
npm run somefuncScript returns BLANK