Skip to content

tsdx lint errors out if you have co-located test files (i.e. no test dir) #342

@pcowgill

Description

@pcowgill

Current 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions