tsdx lint errors out if you have co-located test files (i.e. no test dir)
See original GitHub issueCurrent Behavior
Added tsdx to a project where test files are in the same dirs as the files under test like this:
src/
dir1/
file1.ts
file1.test.ts
… and ran npm run lint
. This is the error generated:
Error: No files matching 'test' were found.
The linter doesn’t finish running because of it.
Desired Behavior
Linter doesn’t error out due to this project structure.
Suggested Solution
Since this is a common project configuration to ensure you have a test suite per file, either edit the default configuration to support this setup or add a flag to tsdx create
or tsdx lint
that supports it.
Who does this impact? Who is this for?
All users, potentially. Specifically, people who have their test files next to their files under test in their dir structure.
Describe alternatives you’ve considered
- A tsdx eject command that lets you override these settings (sort of against the spirit of the project, though)
- Stopping writing tests with this style (but the benefits outweigh the costs)
Additional context
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Change Log - TSDX
The world's leading companies use TSDX to build and test TypeScript packages. ... to: txt (typescript) Error: ENOENT: no such file or directory,...
Read more >Linting errors in react testing - typescript - Stack Overflow
In this case you want to remove the type annotation for TEST_KEY which will make it typed as just string . But then...
Read more >Automated Code Linting and Testing | by Harsh Verma - Medium
Think of setup which solves above drawbacks i.e. will not allow to commit the code without eslint fix ,fix some linting issue or...
Read more >dts-cli | Yarn - Package Manager
Runs your tests using Jest. npm run lint or yarn lint. Runs Eslint with Prettier on .ts and .tsx files. If you want...
Read more >lint-staged - npm
By doing so you can ensure no errors go into the repository and ... JS files inside the /foo directory, so /foo/bar/test.js but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pcowgill, once this PR gets merged, we can change the behavior.
@arthurdenner Perfect, thanks!