I come from a Java and Maven background and when trying to run multiple test files together and sequentially, I'm used to do something like this:
mvn '-Dtest=com.my.directory.tests.*Test' test
Where all my files would have been named finishing with the word Test at the end.
However, I'm now writing some pact tests in Javascript and have them named finishing with .pact.js but can't find an equivalent npm command to run them all one after the other?
Thank you.
In your package.json
scripts you can tell mocha
to test all files matching a given pattern, in your case .pact.js
within the pact
directory:
"scripts": {
"test": "./node_modules/.bin/mocha 'src/pact/**/*.pact.js'",
...
}