Open ospfranco opened 2 years ago
Hi @ospfranco, can you try modulePathIgnorePatterns
?
nope, doesn't work either
Any idea on how to mitigate this in the meantime? before it was just annoying, now I'm integrating playwright tests and now it's just confusing because jest tries to run those as well
Ok, so Blitz's jest-preset has hardcoded ignored paths: https://github.com/blitz-js/blitz/blob/canary/packages/blitz/jest-preset.js#L28, so that issue is there. However, I managed to workaround it with the following code:
// jest.config.ts
import type { Config } from "@jest/types"
const blitzPreset = require("blitz/jest-preset")
const config: Config.InitialOptions = {
...blitzPreset,
projects: blitzPreset.projects.map(p => ({
...p,
testPathIgnorePatterns: [...p.testPathIgnorePatterns, "FOLDER_TO_IGNORE"]
}))
}
export default config
What is the problem?
I have an internal module for deploying some AWS units, this internally have their own tests, when running
yarn test
with blitzjs, the tests inside theaws
folder are picked up, which is undersirable (since they have their own compilation target/config)I've tried setting
testPathIgnorePatterns
in thejest.config.ts
file but it doesn't seem to be working, no matter what I do my tests are still picked up, could this be a problem with the blitz jest preset?Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem: