This commit also changes the test:integration command to run integration
tests as different processes. This allows to avoid any test leaking into
each-other because of the use of singletons. This however has the side
effect of tests being slower, but that is a forcing function to refactor
the code.
Newer mocha-pod allows to setup testfs instances at the global
level. This helps the test suite setup as it can guarantee that certain
files will always be available.
Replace test with test:base to make sure integration tests don't run in CI.
Integration tests for the Supervisor fail when not run in container, leading
to an error-exit and cause the Flowzone CI job for Node to fail.
By returning true, the Flowzone Node CI job succeeds, and this is fine even if tests
fail because they will be caught in the Docker job anyway.
Also, combine original npm test script with test:node.
Signed-off-by: Christina Ying Wang <christina@balena.io>
This allows to run integration tests during development and on CI
with the right dependencies. There are several changes that this
involves, but the gist of it is that a test environment is setup using
`docker-compose.test.yml`. This file is loaded by `resin-ci` during the
build, and ensures that integration tests are ran after setting up all
requirements. This commit also defines a test environment command that
can be setup using `npm run test:env` in order to run tests in a local
development machine.