Skip to content

Commit c397f76

Browse files
Use filename *.jsdom.test.{js,mjs} for JSDOM tests
Also turning on `coverage: true` since they previously had coverage under “JavaScript unit tests”
1 parent f26d60d commit c397f76

File tree

7 files changed

+3
-16
lines changed

7 files changed

+3
-16
lines changed

.github/workflows/tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ jobs:
153153
- description: JavaScript behaviour tests
154154
name: test-behaviour
155155
cache: .cache/jest
156+
coverage: true
156157
projects:
157158
- JavaScript behaviour tests
158159

jest.config.mjs

+2-16
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,8 @@ export default {
108108
{
109109
...config,
110110
displayName: 'JavaScript behaviour tests',
111-
testMatch: [
112-
'**/*.test.{js,mjs}',
113-
114-
// Exclude macro/unit tests
115-
'!**/(*.)?template.test.{js,mjs}',
116-
'!**/*.unit.test.{js,mjs}',
117-
118-
// Exclude other tests
119-
'!**/components/globals.test.js',
120-
'!**/components/*/**',
121-
'!**/tasks/build/**'
122-
],
123-
124-
// Web server required
125-
globalSetup: '@govuk-frontend/helpers/jest/server/start.mjs',
126-
globalTeardown: '@govuk-frontend/helpers/jest/server/stop.mjs'
111+
testEnvironment: '@govuk-frontend/helpers/jest/environment/jsdom.mjs',
112+
testMatch: ['**/*.jsdom.test.{js,mjs}']
127113
},
128114
{
129115
...config,

0 commit comments

Comments
 (0)