Skip to content

Commit

Permalink
Merge pull request #2984 from alphagov/esm-only-packages
Browse files Browse the repository at this point in the history
Upgrade to `del` and `slash` "ESM only" packages
  • Loading branch information
colinrotherham committed Nov 29, 2022
2 parents 70d8387 + 9495171 commit 45c5f2f
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 30 deletions.
17 changes: 13 additions & 4 deletions jest.config.js → jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ const config = {
// See: https://jestjs.io/docs/ecmascript-modules
transform: {
'^.+\\.m?js$': ['babel-jest', { rootMode: 'upward' }]
}
},

// Enable Babel transforms for ESM-only node_modules
// See: https://jestjs.io/docs/ecmascript-modules
transformIgnorePatterns: [
`<rootDir>/node_modules/(?!${[
'del',
'slash'
].join('|')}/)`
]
}

module.exports = {
export default {
collectCoverageFrom: ['./src/**/*.{js,mjs}'],
projects: [
{
Expand Down Expand Up @@ -51,7 +60,7 @@ module.exports = {
...config,
displayName: 'JavaScript behaviour tests',
testMatch: [
'**/*.test.js',
'**/*.test.{js,mjs}',

// Exclude macro/unit tests
'!**/(*.)?template.test.{js,mjs}',
Expand All @@ -73,7 +82,7 @@ module.exports = {
testEnvironment: './config/jest/environment/puppeteer.mjs',
testMatch: [
'**/all.test.{js,mjs}',
'**/components/*/*.test.js',
'**/components/*/*.test.{js,mjs}',

// Exclude macro/unit tests
'!**/(*.)?template.test.{js,mjs}',
Expand Down
Loading

0 comments on commit 45c5f2f

Please sign in to comment.