Everything is ignored by Jest if I ignore "build"

I’m using jest and yarn to test if everything is right, the thing is, it works locally. But when pushing to git/travis, it happens a weird bug.

Project: https://travis-ci.org/github/darklight9811/candlelit

What happens
If I ignore the build folder, it starts ignoring the source folder (no correlation that I can see of). I need to ignore it to prevent the tests from twice (both js and ts).

Configuring Jest · Jest:

<…>
These pattern strings match against the full path. Use the <rootDir> string token to include the path to your project’s root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: ["<rootDir>/build/"] .


https://github.com/darklight9811/candlelit/blob/d3990700d8485e706c53dd1d1aa08d27c9c8c984/jestconfig.json:

<...>
	"modulePathIgnorePatterns": [
		"build"
	]

https://travis-ci.org/github/darklight9811/candlelit/jobs/722424936#L227:

No files found in /home/travis/build/darklight9811/candlelit.

See the resemblance?


Hint: Your project is checked out to /home/travis/build/<your name>/<project name>. So all paths in it match “build”.

1 Like
Imprint