-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #588 from alphagov/fix-components-relying-on-globa…
…l-builds Fix components relying on global builds
- Loading branch information
Showing
4 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@import "../globals/common"; | ||
|
||
@include govuk-exports("footer") { | ||
|
||
$govuk-footer-background: $govuk-grey-3; | ||
|
37 changes: 37 additions & 0 deletions
37
tasks/gulp/__tests__/check-individual-components-compile.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-env jest */ | ||
|
||
const path = require('path') | ||
|
||
const sass = require('node-sass') | ||
|
||
const lib = require('../../../lib/file-helper') | ||
const configPaths = require('../../../config/paths.json') | ||
|
||
const sassRender = (options) => { | ||
return new Promise((resolve, reject) => { | ||
sass.render(options, (error, result) => { | ||
if (error) { | ||
return reject(error) | ||
} | ||
return resolve(result) | ||
}) | ||
}) | ||
} | ||
|
||
describe('Individual components', () => { | ||
it('should compile individual scss files without throwing exceptions', done => { | ||
const componentNames = lib.SrcFilteredComponentList.slice() | ||
|
||
const getSassRenders = () => { | ||
return componentNames.map(name => { | ||
const filePath = path.join(configPaths.src, name, `_${name}.scss`) | ||
return sassRender({ file: filePath }) | ||
}) | ||
} | ||
|
||
Promise | ||
.all(getSassRenders()) | ||
.then(() => { done() }) | ||
.catch(error => { throw error }) | ||
}) | ||
}) |