From 8dc850135ca628dc3cd7827644b866088b80f51f Mon Sep 17 00:00:00 2001 From: Lee Moody Date: Wed, 28 Aug 2019 12:37:07 +0100 Subject: [PATCH] Add $system-code to True tests. (#606) --- lib/tasks/test-sass.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tasks/test-sass.js b/lib/tasks/test-sass.js index de15ede3..f819f948 100644 --- a/lib/tasks/test-sass.js +++ b/lib/tasks/test-sass.js @@ -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, "../../")})))