Skip to content

Commit

Permalink
frontend: set babel-jest cwd to package root
Browse files Browse the repository at this point in the history
fixes import not being recognised in `setupTests.ts` when executing jest from the repo root

ref: jestjs/jest#7359 (comment)
  • Loading branch information
starikcetin committed Feb 28, 2021
1 parent 2318940 commit 6d1a0a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
],
testEnvironment: 'jest-environment-jsdom-fourteen',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { cwd: __dirname }],
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)':
'<rootDir>/config/jest/fileTransform.js',
Expand Down

0 comments on commit 6d1a0a1

Please sign in to comment.