Skip to content

Commit

Permalink
Merge pull request #4985 from alphagov/better-silenced-deprecations
Browse files Browse the repository at this point in the history
Selectively silence deprecations and fix missed warnings
  • Loading branch information
36degrees authored May 22, 2024
2 parents 2b72769 + 3738efa commit 5531c99
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 86 deletions.
155 changes: 87 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Components', () => {

describe('Sass render', () => {
it('renders CSS for all components', () => {
const file = join(paths.package, 'src/govuk/components/_all.scss')
const file = join(paths.package, 'src/govuk/components/_index.scss')

return expect(compileSassFile(file)).resolves.toMatchObject({
css: expect.any(String),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ describe('The helpers layer', () => {
beforeAll(async () => {
sassFiles = await getListing('**/src/govuk/helpers/**/*.scss', {
cwd: paths.package,
ignore: ['**/_all.scss']
ignore: ['**/_all.scss', '**/_index.scss']
})
})

it('should not output any CSS', async () => {
const file = join(paths.package, 'src/govuk/helpers/_all.scss')
const file = join(paths.package, 'src/govuk/helpers/_index.scss')
await expect(compileSassFile(file)).resolves.toMatchObject({ css: '' })
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const sassBootstrap = `
describe('@mixin govuk-typography-common', () => {
it('should output a @font-face declaration by default', async () => {
const sass = `
@import "settings/all";
@import "helpers/all";
@import "settings";
@import "helpers";
:root {
@include govuk-typography-common;
Expand All @@ -86,8 +86,8 @@ describe('@mixin govuk-typography-common', () => {
const sass = `
$govuk-font-family: Helvetica, Arial, sans-serif;
$govuk-font-family-tabular: monospace;
@import "settings/all";
@import "helpers/all";
@import "settings";
@import "helpers";
:root {
@include govuk-typography-common;
Expand All @@ -111,8 +111,8 @@ describe('@mixin govuk-typography-common', () => {
it('should not output a @font-face declaration when the user has turned off this feature', async () => {
const sass = `
$govuk-include-default-font-face: false;
@import "settings/all";
@import "helpers/all";
@import "settings";
@import "helpers";
:root {
@include govuk-typography-common;
Expand Down Expand Up @@ -636,7 +636,7 @@ describe('@mixin govuk-font-size', () => {
}
`

await expect(compileSassString(sass)).resolves.toMatchObject({
await expect(compileSassString(sass, sassConfig)).resolves.toMatchObject({
css: (await compileSassString(expectedSass)).css
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('The objects layer', () => {
beforeAll(async () => {
sassFiles = await getListing('**/src/govuk/objects/**/*.scss', {
cwd: paths.package,
ignore: ['**/_all.scss']
ignore: ['**/_all.scss', '**/_index.scss']
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ describe('The settings layer', () => {
beforeAll(async () => {
sassFiles = await getListing('**/src/govuk/settings/**/*.scss', {
cwd: paths.package,
ignore: ['**/_all.scss']
ignore: ['**/_all.scss', '**/_index.scss']
})
})

it('should not output any CSS', async () => {
const file = join(paths.package, 'src/govuk/settings/_all.scss')
const file = join(paths.package, 'src/govuk/settings/_index.scss')
await expect(compileSassFile(file)).resolves.toMatchObject({ css: '' })
})

Expand Down
4 changes: 2 additions & 2 deletions packages/govuk-frontend/src/govuk/tools/tools.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ describe('The tools layer', () => {
beforeAll(async () => {
sassFiles = await getListing('**/src/govuk/tools/**/*.scss', {
cwd: paths.package,
ignore: ['**/_all.scss']
ignore: ['**/_all.scss', '**/_index.scss']
})
})

it('should not output any CSS', async () => {
const file = join(paths.package, 'src/govuk/tools/_all.scss')
const file = join(paths.package, 'src/govuk/tools/_index.scss')
await expect(compileSassFile(file)).resolves.toMatchObject({ css: '' })
})

Expand Down
Loading

0 comments on commit 5531c99

Please sign in to comment.