Running node index.js
is the same of running npm run cy:run --record --key <YOUR_RECORDING_KEY>
.
I used it here to make the npm run
dynamic without changing the way I managed it.
const npm = require("npm") | |
npm.load(() => { | |
npm["run-script"]([ | |
"cy:run", | |
"--record", | |
"--key", | |
"<YOUR_RECORDING_KEY>" | |
]) | |
}); |
{ | |
"scripts": { | |
"cy:run": "cypress run" | |
}, | |
"devDependencies": { | |
"cypress": "^3.4.1", | |
"npm": "^6.10.3" | |
} | |
} |