-
Notifications
You must be signed in to change notification settings - Fork 508
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
Feature request: Spec files next to sources (co-located tests) #61
Comments
I think it’s possible, but would need to investigate and play with the default TS settings. |
So it's not sufficient to change jest's |
In another project I use Typescript and babel with this config in "jest": {
"rootDir": "src",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx"
],
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest"
}
} I just tried this in my tsdx project, but it doesn't seem to work. |
@mormahr the following does seem to locate the tests... "jest": {
"testMatch": [
"<rootDir>/src/**/?(*.)(spec|test).(ts|js)?(x)"
]
}, but it's failing to find any tests to run
although after looking closer, this might be due to some Typescript errors (I was using Typescript 3.1 and not 3.4.3 like tsdx is currently). I'll investigate more later. |
It did appear to be my failing Typescript types from changes in 3.1 to 3.4.3. Adding |
Would folks be open to updating the default The version below would support both use cases and running
This may have some larger implications, but I think it's worth investigating to keep things as zero-config as possible. |
Yes also: the Essentially: Why not use the default jest config of |
I prefer test files next to the source as well, and would prefer not to have to override the testWatch config in my package.json. |
Is this possible now with v0.8? |
Yes, I prefer the test files be next to the source. It's just so much better than having to switch folders view. |
https://github.com/jaredpalmer/tsdx/blob/master/src/createJestConfig.ts#L12 This is currently possible, and this issue should be closed. |
thanks @kylemh, closing. Will reopen if it doesn't work for me. |
I like having spec files right next to the source files.
Currently this is not achievable. Can we get a support for this style of filesystem organisation?
The text was updated successfully, but these errors were encountered: