Skip to content

Commit

Permalink
Babel transform only *.mjs files for Jest
Browse files Browse the repository at this point in the history
We don’t need to transform `*.js` files as they’re typically supported by Jest already, but we’ll add another commit to handle some exceptions
  • Loading branch information
colinrotherham committed Jun 26, 2023
1 parent d8e3c65 commit 6a75b6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const config = {
*/
testEnvironment: 'jest-environment-node-single-context',

// Enable Babel transforms until Jest supports ESM
// Enable Babel transforms until Jest supports ESM and `import()`
// See: https://jestjs.io/docs/ecmascript-modules
transform: {
'^.+\\.m?js$': ['babel-jest', { rootMode: 'upward' }]
'^.+\\.mjs$': ['babel-jest', { rootMode: 'upward' }]
},

// Enable Babel transforms for ESM-only node_modules
Expand Down

0 comments on commit 6a75b6c

Please sign in to comment.