broccoli-caching-writer
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -40,2 +40,3 @@ var fs = require('fs'); | ||
self.updateCache(srcDir, self.getCleanCacheDir()); | ||
self._cacheHash = inputTreeHash; | ||
} | ||
@@ -42,0 +43,0 @@ |
{ | ||
"name": "broccoli-caching-writer", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Broccoli plugin that allows simple caching (while still allowing N:N) based on the input tree hash.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,3 +18,3 @@ 'use strict'; | ||
var sourcePath = 'tests/fixtures/sample-project'; | ||
var dummyChangedFile = sourcePath + 'dummy-changed-file'; | ||
var dummyChangedFile = sourcePath + '/dummy-changed-file'; | ||
@@ -41,3 +41,3 @@ afterEach(function() { | ||
builder = new broccoli.Builder(tree); | ||
return builder.build().then(function() { | ||
return builder.build().finally(function() { | ||
expect(updateCacheCalled).to.be.ok(); | ||
@@ -71,4 +71,4 @@ }); | ||
.then(function() { | ||
expect(updateCacheCount).to.be.ok(1); | ||
}) | ||
expect(updateCacheCount).to.eql(1); | ||
}); | ||
}); | ||
@@ -87,11 +87,17 @@ | ||
return builder.build() | ||
.finally(function() { | ||
expect(updateCacheCount).to.eql(1); | ||
}) | ||
.then(function() { | ||
expect(updateCacheCount).to.be.ok(1); | ||
fs.writeFileSync(dummyChangedFile, 'bergh'); | ||
return RSVP.all([builder.build(), builder.build(), builder.build()]) | ||
return RSVP.all([ | ||
builder.build(), | ||
builder.build(), | ||
builder.build() | ||
]) | ||
}) | ||
.then(function() { | ||
expect(updateCacheCount).to.be.ok(2); | ||
}) | ||
.finally(function() { | ||
expect(updateCacheCount).to.eql(2); | ||
}); | ||
}); | ||
@@ -109,3 +115,3 @@ }); | ||
builder = new broccoli.Builder(tree); | ||
return builder.build().then(function(dir) { | ||
return builder.build().finally(function(dir) { | ||
expect(fs.readFileSync(dir + '/something-cool.js', {encoding: 'utf8'})).to.eql('zomg blammo'); | ||
@@ -112,0 +118,0 @@ }); |
9626
202