mem-fs-editor
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -44,3 +44,2 @@ 'use strict'; | ||
delete file.state; | ||
this.push(file); | ||
cb(); | ||
@@ -47,0 +46,0 @@ }); |
{ | ||
"name": "mem-fs-editor", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "File edition helpers working on top of mem-fs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
mem-fs-editor | ||
mem-fs-editor [![Build Status](https://travis-ci.org/SBoudrias/mem-fs-editor.svg?branch=master)](https://travis-ci.org/SBoudrias/mem-fs-editor) | ||
============= | ||
@@ -3,0 +3,0 @@ |
@@ -14,8 +14,17 @@ 'use strict'; | ||
describe('#commit()', function () { | ||
var fixtureDir = path.join(os.tmpdir(), '/mem-fs-editor-test-fixture'); | ||
var output = path.join(os.tmpdir(), '/mem-fs-editor-test'); | ||
beforeEach(function(done) { | ||
rimraf.sync(fixtureDir); | ||
var store = memFs.create(); | ||
this.fs = editor.create(store); | ||
this.fs.copy(__dirname + '/fixtures/**', output); | ||
mkdirp.sync(fixtureDir); | ||
// Create a 100 files to exercise the stream high water mark | ||
var i = 100; | ||
while (i--) { | ||
fs.writeFileSync(path.join(fixtureDir, 'file-' + i + '.txt'), 'foo'); | ||
} | ||
this.fs.copy(fixtureDir + '/**', output); | ||
rimraf(output, done); | ||
@@ -39,4 +48,4 @@ }); | ||
this.fs.commit([filter], function () { | ||
assert.equal(called, 5); | ||
assert.equal(this.fs.read(path.join(output, 'file-a.txt')), 'modified'); | ||
assert.equal(called, 100); | ||
assert.equal(this.fs.read(path.join(output, 'file-1.txt')), 'modified'); | ||
done(); | ||
@@ -48,3 +57,5 @@ }.bind(this)); | ||
this.fs.commit(function () { | ||
assert(fs.existsSync(path.join(output, 'file-a.txt'))); | ||
assert(fs.existsSync(path.join(output, 'file-1.txt'))); | ||
assert(fs.existsSync(path.join(output, 'file-50.txt'))); | ||
assert(fs.existsSync(path.join(output, 'file-99.txt'))); | ||
done(); | ||
@@ -51,0 +62,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19710
455