We have a set of integration tests defined in this project to help ensure we don't inadvertently break downstream packages that depend on us.
These tests are setup to run within docker containers to ensure that each test is completely isolated; we don't want them to affect our local environment, and similarly we don't want them to be effected by our local environment.
- Install docker for your platform.
- Add a new folder in
/tests/integration/fixtures
- Add a
.eslintrc.yml
, and atsconfig.json
to your folder, with the config required. - Create the necessary files to test the integration.
- Copy+paste the
Dockerfile
from an existing fixture (they are all the same). - Copy+paste the
test.sh
from an existing fixture, and adjust theeslint
command as required. - Add a new entry to
docker-compose.yml
by copy+pasting an existing section, and changing the name to match your new folder. - Add a new entry to
run-all-tests.sh
by copy+pasting an existing command, and changing the name to match your new folder. - Run your integration test by running the single command you copied in the previous step.
- If your test finishes successfully, a
test.js.snap
will be created.
- If your test finishes successfully, a
If you run your test and see the test fail with Cannot find module './lint-output.json' from 'test.js'
, this means that ESLint errored whilst attempting to run the lint command.