Skip to content

Commit

Permalink
fix: esm tests global jest
Browse files Browse the repository at this point in the history
  • Loading branch information
rostyk-kanafotskyy committed Nov 7, 2024
1 parent 500ff43 commit 0fa19f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ const jestConfig: JestConfigWithTsJest = {
'ts-jest',
{
useESM: true,
tsconfig: {
esModuleInterop: true,
allowSyntheticDefaultImports: true
}
},
],
},
globals: {
'ts-jest': {
useESM: true,
},
},
collectCoverageFrom: [
'packages/*/src/**/*.ts',
'!packages/**/__tests__/**/*',
Expand Down Expand Up @@ -50,6 +49,7 @@ const jestConfig: JestConfigWithTsJest = {
},
},
testMatch: ['**/__tests__/**/*.test.ts', '**/*.test.ts'],
setupFiles: ['<rootDir>/setup-jest.js'],
};

export default jestConfig;
3 changes: 3 additions & 0 deletions setup-jest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { jest } from '@jest/globals';

global.jest = jest;

0 comments on commit 0fa19f9

Please sign in to comment.