-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore/filter some tests from auto run/watcher #475
Comments
jest's projects setting is a bit misleading, for a given config file, it will run all projects stated there, you can't pick and choose them by name. However, you can create multiple jest config with different "projects" setting, see more discussion in this thread. If applicable, you can also consider using vscode's multiroot workspace together with the up-coming 3.0.1 pre-release, instead of jest's multi-project setting. |
Thanks for getting back to me. We are using jests multiple configs to separate out the tests and the configs for the different types (plain javascript vs end to end tests). I am running the 3.0.1 pre release, but we cannot use the multi-project aspect as the code we are testing is all in the one root, just two different types of tests. Open to a PR which added a setting that would enable some tests to not be automatically run on start/change? |
I think there might be an easier solution, why not just create a separate jest config file with the projects you want to run, customize with any one of the below:
This extension tries not to diverge from how jest run tests, therefore it is probably better to defer to jest's config driven approach rather than creating our own test selection logic... |
Fair point, I will need to figure out how we work that into our CI, but that's probably a lot simpler than a PR to add the feature, which like you said then diverges! Thanks for the advice and suggestion, great extension! |
In case anyone else finds this, I managed to get it working by keeping the single jest config file with projects.. and added the following to scripts in package.json: Then: |
Environment
node -v
: v10.15.3npm -v
: 6.4.1npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): jest@24.8.0Prerequisite
npm run test
ornode_modules/.bin/jest
) npm testUsing the following multi project config for jest:
Is there a way to disable the auto running/watcher for the e2e tests ? They are slow to run, and we find that when we make changes to the tests in the js section, the e2e tests are re run if we have runner started.
The text was updated successfully, but these errors were encountered: