Skip to content

Commit

Permalink
#20 Add throw error code. Add hack for test no_cache option.
Browse files Browse the repository at this point in the history
  • Loading branch information
tormozz48 committed Jun 29, 2015
1 parent 547fd22 commit 5fb5566
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion techs/borschik.js
Expand Up @@ -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();
14 changes: 10 additions & 4 deletions test/techs/borschik.test.js
Expand Up @@ -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); }'
Expand All @@ -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();
Expand All @@ -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);
});
});
});
Expand Down

0 comments on commit 5fb5566

Please sign in to comment.