Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to check if sass in packages compiles when copied over #669

Merged
merged 2 commits into from
Apr 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Internal:
(PR [#663](https://github.com/alphagov/govuk-frontend/pull/663))
- Exclude test related files from `dist/` and `packages/` copy task
(PR [#662](https://github.com/alphagov/govuk-frontend/pull/662))
- Add test to check if Sass in packages compiles correctly after the `build:packages` task
(PR [#669](https://github.com/alphagov/govuk-frontend/pull/669))

## 0.0.28-alpha (Breaking release)

Expand Down
14 changes: 14 additions & 0 deletions tasks/gulp/__tests__/after-build-packages.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/* eslint-env jest */

const path = require('path')
const util = require('util')
const sass = require('node-sass')

const lib = require('../../../lib/file-helper')
const configPaths = require('../../../config/paths.json')

const sassRender = util.promisify(sass.render)

describe('building packages/', () => {
describe('when running copy-to-destination', () => {
Expand All @@ -26,4 +33,11 @@ describe('building packages/', () => {
lib.SrcComponentList.forEach((componentName) => {
defineTestsForComponent(componentName)
})

describe('after running copy-to-destination', () => {
it('scss files should compile without throwing an exeption', async () => {
const allScssFile = path.join(configPaths.packages, 'all', '_all.scss')
await sassRender({ file: allScssFile })
})
})
})