Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
collectCoverage: true,
testEnvironment: 'node',
setupFiles: ['<rootDir>/setupTests.js'],
testPathIgnorePatterns: ['<rootDir>/src/', '<rootDir>/tests/integration/'],
setupFiles: ['./setupTests.js'],
testPathIgnorePatterns: ['./src/', './tests/integration/'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex wildcard in testPathIgnorePatterns may over-exclude tests

Medium Severity

testPathIgnorePatterns values are treated as regex patterns matched against absolute file paths, not as file system paths. The . in ./src/ and ./tests/integration/ is a regex wildcard (matching any character), not a literal dot meaning "current directory." While <rootDir> was a special Jest token that got replaced with the actual project root path (yielding a precise pattern like /home/user/sentry-cli/src/), ./src/ is a loose regex matching any path containing <any-char>/src/. If the project lives under a path containing /src/ (e.g., /home/dev/src/sentry-cli/), this pattern would match and exclude all test files. The PR description indicates only setupFiles had the <rootDir> resolution issue — testPathIgnorePatterns may not have needed changing.

Fix in Cursor Fix in Web

transform: {
'^.+\\.ts$': 'ts-jest',
},
Expand Down