This SDK uses jest for its testing suite. The tests are split up into unit tests, which verify the internal workings of the code and do not rely on a network connection, and integration tests, which verify the SDK against live instances of Watson services.
This repository includes scripts for running the tests. These scripts use the --silent
and --verbose
options.
To run a single test on its own or to run the tests with custom options, install jest
globally.
$ npm install -g jest
$ npm run test-unit
# or
$ jest test/unit/
$ npm run test-integration
# or
$ jest test/integration/
# can be a path to any file or multiple files using globs and/or regular expressions
$ jest test/unit/baseService.test.js
$ npm test
# or
$ jest test/