This package allows you to use jest to run your atom's extension tests.
Please note, that this package may not satisfy your needs due to some difficulties with integration. Not solved issues:
- no global atom variable
- keyboard interaction does not work in watch mode :(
- on some projects it may fail with
TypeError: Cannot redefine property: length
error in oniguruma package. There is an issue in jest repository regarding this case.
$ apm install --save-dev atom-jest-test-runner
Simply add atomTestRunner
field in you package.json
:
{
"name": "hello-world",
// ...
"atomTestRunner": "atom-jest-test-runner"
}
then simply run:
$ atom --test test
You can also run tests in watch mode, while developing a package. Because the jest will be executed by separate process, you won't be able to pass cli options directly, so you need to use env variables for that:
$ TEST_MODE='watch' atom --test test
This package uses itself to test itself :D So you can browse current repository to see how it was set up.