During my exploration of Jasmine, I found that I could easily include the following snippet in my package.json
:
"scripts": {
"test": "jasmine"
},
By executing npm test
from a Windows command prompt, I was able to run my Jasmine tests using npm.
However, when working with Cucumber-JS, utilizing "test": "cucumber"
only resulted in opening node_modules\.bin\cucumber.js
in my text editor. It seemed necessary to use the following approach to execute the tests:
"scripts": {
"test": "cucumber.js.cmd"
},
This solution appears to be very specific to the platform, and I would prefer not to create difficulties for fellow developers using Mac or Linux.
Is there a universal value that can be used for the "test" command that will function across different operating systems?
EDIT:
I want to point out that although my question bears similarities to this query concerning mocha, it is not identical. While the answer provided for that question (utilizing the package name, mocha
) resolved the issue, using the package name (cucumber
) did not lead to success in this scenario.