Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Add $system-code to True tests. (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
notlee authored Aug 28, 2019
1 parent f5ebcf0 commit 8dc8501
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/tasks/test-sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ const trueTest = function (config) {
const testRunner = path.join(config.cwd, 'test/scss/test-runner.js');
return writeFile(testRunner, `
const path = require('path');
const fs = require('fs');
const componentBase = path.join(__dirname, '../../');
const sassFile = path.join(__dirname, 'index.test.scss');
const sassTrue = require('${require.resolve('sass-true')}');
const getSassIncludePaths = ${files.getSassIncludePaths.toString()};
const sass = '$system-code: "origami-build-tools";' + fs.readFileSync(sassFile);
sassTrue.runSass({
file: sassFile,
data: sass,
// We use this to silence the sass console output when running "obt test".
functions: {},
includePaths: getSassIncludePaths(componentBase, ${JSON.stringify(config)})
includePaths: [__dirname].concat(getSassIncludePaths(componentBase, ${JSON.stringify(config)}))
}, describe, it);
`)
.then(() => commandLine.run('mocha', ['test/scss'], Object.assign({}, config, { localDir: path.join(__dirname, "../../")})))
Expand Down

0 comments on commit 8dc8501

Please sign in to comment.