From 03cb2437da4a3320a99f6ba74786324848d3c604 Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 20 Apr 2018 12:50:48 +0100 Subject: [PATCH] Make sass-true understand how to include sass files from bower_components folder (#521) --- lib/tasks/test-sass.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/tasks/test-sass.js b/lib/tasks/test-sass.js index cb90f7dd..753c23bf 100644 --- a/lib/tasks/test-sass.js +++ b/lib/tasks/test-sass.js @@ -13,9 +13,15 @@ const trueTest = function (config) { const testRunner = path.join(config.cwd, 'test/scss/test-runner.js'); return writeFile(testRunner, ` const path = require('path'); + const componentBase = path.join(__dirname, '../../'); const sassFile = path.join(__dirname, 'index.test.scss'); const sassTrue = require('${require.resolve('sass-true')}'); - sassTrue.runSass({file: sassFile}, describe, it); + sassTrue.runSass({ + file: sassFile, + // We use this to silence the sass console output when running "obt test". + functions: {}, + includePaths: [componentBase, path.join(componentBase, 'bower_components')] + }, describe, it); `) .then(() => commandLine.run('mocha', ['test/scss'], Object.assign({}, config, { localDir: path.join(__dirname, "../../")}))) .finally(() => unlink(testRunner));