Skip to content

Commit

Permalink
Fix deprecations due to jest
Browse files Browse the repository at this point in the history
1. Remove accidental async in describe()
2. Config key renamed to `setupFilesAfterEnv`
  • Loading branch information
colinrotherham committed Apr 17, 2019
1 parent 85383dd commit eadafef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
]
},
"jest": {
"setupTestFrameworkScriptFile": "./config/jest-setup.js",
"setupFilesAfterEnv": [
"./config/jest-setup.js"
],
"snapshotSerializers": [
"jest-serializer-html"
],
Expand Down
4 changes: 2 additions & 2 deletions src/all.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ afterAll(async (done) => {
})

describe('GOV.UK Frontend', () => {
describe('javascript', async () => {
describe('javascript', () => {
it('can be accessed via `GOVUKFrontend`', async () => {
await page.goto(baseUrl + '/', { waitUntil: 'load' })

Expand Down Expand Up @@ -113,7 +113,7 @@ describe('GOV.UK Frontend', () => {
await page.waitForSelector('#conditional-scoped-1', { hidden: false })
})
})
describe('global styles', async () => {
describe('global styles', () => {
it('are disabled by default', async () => {
const sass = `
@import "all";
Expand Down
2 changes: 1 addition & 1 deletion src/components/error-summary/error-summary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Error Summary', () => {
['a conditionally revealed input', 'yes-input', '#test-conditional-reveal legend']
]

describe.each(inputTypes)('when linking to %s', async (_, inputId, legendOrLabelSelector) => {
describe.each(inputTypes)('when linking to %s', (_, inputId, legendOrLabelSelector) => {
beforeAll(async () => {
await page.goto(`${baseUrl}/examples/error-summary`, { waitUntil: 'load' })
await page.click(`.govuk-error-summary a[href="#${inputId}"]`)
Expand Down

0 comments on commit eadafef

Please sign in to comment.