Skip to content

Test

To run tests, use the following command:

Terminal window
npm test

Simplified test suite skips few time consuming tests and runs faster:

Terminal window
npm test-minimum

To execute a specific test, use the testNamePattern option with test-dbg script. For example:

Terminal window
npm run test-dbg -- --testNamePattern="batch"

IT suite starts the server for testing - standalone and cluster installation using cluster_manager script. To run the integration tests with existing servers, run the following command:

Terminal window
npm run test-dbg -- --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379
# If those endpoints use TLS, add `--tls=true` (applies to both endpoints)
npm run test-dbg -- --cluster-endpoints=localhost:7000 --standalone-endpoints=localhost:6379 --tls=true

Parameters cluster-endpoints, standalone-endpoints and tls could be used with all test suites.

By default, the server modules tests do not run using npm run test. This test suite also does not start the server. In order to run these tests, use:

Terminal window
npm run test-modules -- --cluster-endpoints=<address>:<port>

Note: these tests don’t run with standalone server as of now.