Skip to content
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

Update createJestConfig.ts testMatch to allow for other folder structures like co-located tests #159

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

kylemh
Copy link
Contributor

@kylemh kylemh commented Jun 24, 2019

I like to pair testing files with my source code files so everything is collocated in a file explorer. This shouldn't be a breaking change and will simply allow me to create test files outside of the initially created test folder.

I like to pair testing files with my source code files so everything is collocated in a file explorer. This shouldn't be a breaking change and will simply allow me to create test files outside of the initially created `test` folder.
@kylemh kylemh changed the title Update createJestConfig.ts to allow for other folder structures Update createJestConfig.ts testMatch to allow for other folder structures Jun 24, 2019
@kylemh
Copy link
Contributor Author

kylemh commented Jul 1, 2019

Anything wrong with this @sw-yx ?

@kylemh
Copy link
Contributor Author

kylemh commented Jul 8, 2019

@jaredpalmer https://jestjs.io/docs/en/configuration#testpathignorepatterns-array-string

It looks like any node_modules is ignored by default. I didn't see testPathIgnorePatterns defined in the config, but I could make it explicit in this config to prevent future issues.

@nobitagit
Copy link

nobitagit commented Jul 15, 2019

Just chiming in to say that I tested this on one of my projects and indeed it doesn't run node_modules tests, if that helps.

As @kylemh says one is still free to keep tests under test but now has the option to co-locate, so no breaking changes.

PS - maybe worth updating the docs as well as part of this PR to note that it's possible to co-locate spec files?

@jaredpalmer
Copy link
Owner

Coolz.

@jaredpalmer jaredpalmer merged commit f6ecdc9 into jaredpalmer:master Jul 15, 2019
@kylemh kylemh deleted the patch-1 branch July 15, 2019 16:50
@agilgur5 agilgur5 changed the title Update createJestConfig.ts testMatch to allow for other folder structures Update createJestConfig.ts testMatch to allow for other folder structures like co-located tests Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants