Skip to content

Commit

Permalink
Use filename *.jsdom.test.{js,mjs} for JSDOM tests
Browse files Browse the repository at this point in the history
Also turning on `coverage: true` since they previously had coverage under “JavaScript unit tests”
  • Loading branch information
colinrotherham committed Sep 13, 2023
1 parent f26d60d commit c397f76
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ jobs:
- description: JavaScript behaviour tests
name: test-behaviour
cache: .cache/jest
coverage: true
projects:
- JavaScript behaviour tests

Expand Down
18 changes: 2 additions & 16 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,8 @@ export default {
{
...config,
displayName: 'JavaScript behaviour tests',
testMatch: [
'**/*.test.{js,mjs}',

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

// Exclude other tests
'!**/components/globals.test.js',
'!**/components/*/**',
'!**/tasks/build/**'
],

// Web server required
globalSetup: '@govuk-frontend/helpers/jest/server/start.mjs',
globalTeardown: '@govuk-frontend/helpers/jest/server/stop.mjs'
testEnvironment: '@govuk-frontend/helpers/jest/environment/jsdom.mjs',
testMatch: ['**/*.jsdom.test.{js,mjs}']
},
{
...config,
Expand Down

0 comments on commit c397f76

Please sign in to comment.