Skip to content

Commit a8d8670

Browse files
Merge pull request #6392 from alphagov/log-remaining-govuk-function-calls
2 parents af005f1 + 894a6fa commit a8d8670

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/govuk-frontend/src/govuk/all.unit.test.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,12 @@ describe('GOV.UK Frontend', () => {
9494
it('does not contain any unexpected govuk- function calls', async () => {
9595
const sass = '@import "index"'
9696

97-
await expect(compileSassString(sass)).resolves.toMatchObject({
98-
css: expect.not.stringMatching(/_?govuk-[\w-]+\(.*?\)/g)
99-
})
97+
const { css } = await compileSassString(sass)
98+
const matches = css.matchAll(/_?govuk-[\w-]+\(.*?\)/g)
99+
100+
// `matchAll` does not return an actual `Array` so we need
101+
// a little conversion before we can check its length
102+
expect(Array.from(matches)).toHaveLength(0)
100103
})
101104

102105
describe('Sass documentation', () => {

0 commit comments

Comments
 (0)