mardi 28 mars 2017

How to stop jest running test constants folder

I am testing a React-Redux JS app with Jest, but I am having trouble stopping jest running my constants folder. I am using my constants folder to store various snapshots of the state and for mocking api responses as they can be quite large and I do not want them inline, and I may want to reuse in the future.

My folder structure is similar to below, where testStates is my constants folder: |- __tests__ |- some tests |- testStates |- state_errors |- state_some_errors |- app

I have tried using the package.json to ignore module paths as the Jest documentation suggests here. However, as the documentation also says, I now cannot import/require these constants into my test suites.

Is there a way to exclude folders inside the test folder from being run, but also allow for importing in test suites?

Thanks

Aucun commentaire:

Enregistrer un commentaire