diff --git a/jest.config.js b/jest.config.js index 84c58739ac9..48dba771a53 100644 --- a/jest.config.js +++ b/jest.config.js @@ -46,7 +46,7 @@ module.exports = { ...config, displayName: 'JavaScript behaviour tests', testMatch: [ - '**/*.test.js', + '**/*.test.{js,mjs}', // Exclude macro/unit tests '!**/(*.)?template.test.{js,mjs}', @@ -68,7 +68,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}', diff --git a/src/govuk/all.test.js b/src/govuk/all.test.mjs similarity index 95% rename from src/govuk/all.test.js rename to src/govuk/all.test.mjs index 71446f49926..3390d507ae4 100644 --- a/src/govuk/all.test.js +++ b/src/govuk/all.test.mjs @@ -1,10 +1,10 @@ -const sassdoc = require('sassdoc') -const slash = require('slash') +import sassdoc from 'sassdoc' +import slash from 'slash' -const configPaths = require('../../config/paths.js') +import configPaths from '../../config/paths.js' -const { renderSass } = require('../../lib/jest-helpers') -const { goTo, goToExample } = require('../../lib/puppeteer-helpers') +import { renderSass } from '../../lib/jest-helpers' +import { goTo, goToExample } from '../../lib/puppeteer-helpers' describe('GOV.UK Frontend', () => { describe('javascript', () => {