In the root of your application should be a package.json
file, where you can define scripts and devDependencies.
{
"name": "myapp",
"version": "1.0.0",
"scripts": {
"start": "meteor --settings settings-development.json",
"nightwatch": "nightwatch -c .meteor/nightwatch.json",
"phantom": "nightwatch -c .meteor/nightwatch.json --env phantom",
}
}
You will then be able to launch nightwatch with the following commands:
meteor npm run-script nightwatch
meteor npm run-script phantom
In this example, it would almost be easier to simply run nightwatch -c .meteor/nightwatch.json
. However, with more complex commands, with complex environment variables, options, and settings, this becomes a very useful way to specify devops scripts for a team.