Testing scripts
This page documents all the NPM scripts associated with testing.
caution
RadGrad testing might not be fully supported on the Windows platform. In particular, the test-all script might fail on Windows, either because the unimported script fails or because the test-acceptance script triggers a timeout.
If you are experiencing either of these issues on Windows, then one workaround is to run the testing commands individually:
- meteor npm run lint
- meteor npm run test-unit
- meteor npm run test-integration
- meteor npm run test-acceptance-development
If all of those pass, then you can ask a fellow developer on a Unix platform to run the unimported command on your branch (if unimported does not succeed for you). Or, if you're feeling lucky, just merge your changes into master and monitor the CI build on GitHub.
meteor npm run lint
This command checks the code according to our RadGrad ESLint guidelines.
Example invocation and output:
meteor npm run unimported
This command checks to see if there is any unused components:
Example invocation and output:
meteor npm run test-unit
This command runs all of the unit (server-only) tests, unless MOCHA_GREP is set, in which case only the subset of unit tests matching the string in MOCHA_GREP are run.
Example (abbreviated) output:
For more details, see How to write unit tests.
meteor npm test-integration
Runs all of the integration tests (i.e. tests of Meteor Methods), unless MOCHA_GREP is set, in which case only the subset of unit tests matching the string in MOCHA_GREP are run.
Example invocation and (abbreviated) output:
For more details, see How to write integration tests.
meteor npm run test-acceptance-development
To run the acceptance tests in development mode, first bring up a development version of RadGrad by invoking meteor npm run start
.
Then, in a separate command shell, run the acceptance tests as follows:
Running the acceptance tests in development mode pops up a Chrome browser window so you can see the progress of the tests. This makes it much easier to debug your test code.
For more details, see How to write acceptance tests.
meteor npm run test-acceptance
This command runs the acceptance tests in "batch" or "continuous integration" mode. You do not need to (and indeed cannot) start up an instance of RadGrad. No Chrome window will pop up.
Here is a sample invocation:
meteor npm run test-all
This command sequentially invokes lint, then test-unit, then test-integration, and finally test-acceptance.
As its name implies, it does all the testing.
caution
This commmand does not work on Windows, since it invokes npx unimported.