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

Ignore setupFiles files #2028

Closed
monolithed opened this issue Oct 30, 2016 · 4 comments
Closed

Ignore setupFiles files #2028

monolithed opened this issue Oct 30, 2016 · 4 comments

Comments

@monolithed
Copy link

{
    "testPathDirs": [
        "./tests"
    ],

    "setupFiles": [
        "./tests/setup.js"
    ],

    "testPathIgnorePatterns": [
        "./tests/setup.js"
    ]
}
 FAIL  tests/setup.js
  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/jest/node_modules/jest-cli/build/TestRunner.js:189:18)
      at process._tickCallback (internal/process/next_tick.js:103:7)

It would be nice if these copy paste rules could be skipped by default.
Also I don't understand why glob pattern is not supported yet.

@pastuxso
Copy link
Contributor

Hello @monolithed, in my case I'm using "testRegex": "/__tests__/.*\\.spec\\.js$", this helps to test only files ending in .spec.js

@monolithed
Copy link
Author

@pastuxso, thanks. I've already solved that via additional directory, because .spec is not relevant for me due to #1650.

@cpojer
Copy link
Member

cpojer commented Oct 31, 2016

You'll have to use testPathIgnorePatterns to exclude the file or adjust your testRegex. Currently setupFiles will be counted as test files if they match the test regex.

@cpojer cpojer closed this as completed Oct 31, 2016
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants