question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to add folders to have jest ignore

See original GitHub issue

We currently have a couple of submodules that are outside of the src directory that we would like jest to ignore. The only way we’ve found to do this currently is to replace the test script with one of our own. While this isn’t a big deal, it would be nice to be able to ignore these directories within our package.json

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
gaearoncommented, May 17, 2017

Right, but why do you need to put normalised-test-data.js into __tests__? You can put it outside of the folder.

0reactions
woilecommented, Mar 25, 2018

Hi i’m having a similar issue, I have fakers inside the __tests__ folder, I believe they belong there. It would be awesome to have a way to ignore a folder or files.

Right now I’m planning on solving this by moving them outside the __tests__ folder.

An easy approach could be ignoring files with a particular key. Like file.test.js but the opposite. Maybe something like myFile.ignore.test.js, or someone with more creativity can think of a better one.

Thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I exclude files from Jest watch? - Stack Overflow
To exclude an entire folder, add the following in the "jest" property of the package.json file:
Read more >
Configuring Jest
Use the <rootDir> string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your...
Read more >
Which jest config option do I use to ignore a particular folder
i have a dist folder i want to ignore jest config options not figuring it out.
Read more >
How to run, ignore or skip Jest tests, suites and files
Run a single Jest test file with the CLI. See Running the examples to get set up, then run: With the CLI, you...
Read more >
Setup - Testing Library
To make your custom test file accessible in your Jest test files without using relative imports ( ../../test-utils ), add the folder containing ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found