From e0abe23b4a07463de9413f222319b5b756bc5c5f Mon Sep 17 00:00:00 2001 From: coreequip Date: Sat, 19 Mar 2016 17:32:30 +0100 Subject: [PATCH] Fixed tests and compatibility with bourbon. --- index.js | 15 ++++----------- test/with_test.js | 7 +++++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 104c0cd..17a62ba 100644 --- a/index.js +++ b/index.js @@ -1,20 +1,13 @@ var path = require('path'); -var bourbonEntryPoint = require.resolve('bourbon'); - -var bourbonDir = path.dirname(bourbonEntryPoint); - -function includePaths() { - return [bourbonDir]; -} +var bourbon = require('bourbon'); module.exports = { - includePaths: includePaths(), + includePaths: [bourbon.includePaths], with: function() { var paths = Array.prototype.slice.call(arguments); - var result = [].concat.apply(includePaths(), paths); - return result; + return [].concat.apply([bourbon.includePaths], paths); } -}; +}; \ No newline at end of file diff --git a/test/with_test.js b/test/with_test.js index f44bf79..3baedf4 100644 --- a/test/with_test.js +++ b/test/with_test.js @@ -21,6 +21,7 @@ describe('#with function', function() { includePaths: bourbon.with(partialsDir('dir1'), partialsDir('dir2'), partialsDir('dir3')), error: errorHandler }, function(err, res) { + if (err) return done(err); done(); }); }); @@ -30,7 +31,8 @@ describe('#with function', function() { file: __dirname + '/fixtures/concat.scss', includePaths: bourbon.with([partialsDir('dir1')], [partialsDir('dir2')], [partialsDir('dir3')]), error: errorHandler - }, function() { + }, function(err, res) { + if (err) return done(err); done(); }); }); @@ -40,7 +42,8 @@ describe('#with function', function() { file: __dirname + '/fixtures/concat.scss', includePaths: bourbon.with([partialsDir('dir1'), partialsDir('dir2')], partialsDir('dir3')), error: errorHandler - }, function() { + }, function(err, res) { + if (err) return done(err); done(); }); });