From 5fb5566e141608f32ee1ea39795d89ac121c44b7 Mon Sep 17 00:00:00 2001 From: tormozz48 Date: Mon, 29 Jun 2015 19:01:08 +0300 Subject: [PATCH] #20 Add throw error code. Add hack for test no_cache option. --- techs/borschik.js | 3 ++- test/techs/borschik.test.js | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/techs/borschik.js b/techs/borschik.js index d25627f..3d47569 100644 --- a/techs/borschik.js +++ b/techs/borschik.js @@ -68,8 +68,9 @@ module.exports = require('enb/lib/build-flow').create() .then(function () { borschikProcessor.dispose(); }) - .fail(function () { + .fail(function (err) { borschikProcessor.dispose(); + throw err; }); }) .createTech(); diff --git a/test/techs/borschik.test.js b/test/techs/borschik.test.js index 8a9bc1e..fd59e9c 100644 --- a/test/techs/borschik.test.js +++ b/test/techs/borschik.test.js @@ -282,7 +282,8 @@ describe('borschik', function () { describe('cache', function () { it('should skip rebuild with disabled "no_cache" tech option', function () { - var bundle, + var launchCount = 0, + bundle, scheme1 = { configFile: { paths: { './': '/borschik1/' } }, 'bundle.css': '.block { background-image: url(./a1/b1.gif); }' @@ -296,10 +297,15 @@ describe('borschik', function () { }; writeFiles(scheme1); - bundle = new MockNode('bundle'); + + Tech.prototype._saveBuildResult = function () { + launchCount++; + }; + return bundle.runTechAndGetContent(Tech, options) .spread(function (content1) { + launchCount.must.equal(1); content1.must.equal('.block { background-image: url("/borschik1/a1/b1.gif"); }'); clearConfigCache(); @@ -311,8 +317,8 @@ describe('borschik', function () { writeFiles(scheme2); return bundle.runTechAndGetContent(Tech, options) - .spread(function (content2) { - content2.must.equal('.block { background-image: url("/borschik1/a1/b1.gif"); }'); + .spread(function () { + launchCount.must.equal(1); }); }); });