Comparing version
@@ -8,3 +8,3 @@ 'use strict'; | ||
module.exports = function(jsb3){ | ||
var deferred = Q.defer(), | ||
var deferred = Q.defer(), | ||
input = fs.createReadStream(jsb3), | ||
@@ -11,0 +11,0 @@ files = []; |
{ | ||
"name": "jsb3", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Process a jsb3 file into an array of files", | ||
@@ -14,3 +14,5 @@ "main": "index.js", | ||
"keywords": [ | ||
"jsb3" | ||
"jsb3", | ||
"sencha", | ||
"extjs" | ||
], | ||
@@ -17,0 +19,0 @@ "author": "Bjørn Harald Olsen", |
46
test.js
@@ -7,28 +7,28 @@ 'use strict'; | ||
it('should read all files from jsb3 stream', function(cb){ | ||
jsb3('testfiles/file1.jsb3').then(function(files){ | ||
assert.equal(files.length, 2); | ||
assert.strictEqual('folder1', path.dirname(files[0])); | ||
assert.strictEqual('file.txt', path.basename(files[0])); | ||
assert.strictEqual('folder2', path.dirname(files[1])); | ||
assert.strictEqual('file.pdf', path.basename(files[1])); | ||
cb(); | ||
}).fail(function(message){ | ||
assert(false, message); | ||
cb(); | ||
}); | ||
jsb3('testfiles/file1.jsb3').then(function(files){ | ||
assert.equal(files.length, 2); | ||
assert.strictEqual('folder1', path.dirname(files[0])); | ||
assert.strictEqual('file.txt', path.basename(files[0])); | ||
assert.strictEqual('folder2', path.dirname(files[1])); | ||
assert.strictEqual('file.pdf', path.basename(files[1])); | ||
cb(); | ||
}).fail(function(message){ | ||
assert(false, message); | ||
cb(); | ||
}); | ||
}); | ||
it('should read all files from jsb3 stream with multiple projects', function(cb){ | ||
jsb3('testfiles/file2.jsb3').then(function(files){ | ||
assert.equal(files.length, 2); | ||
assert.strictEqual('folder1', path.dirname(files[0])); | ||
assert.strictEqual('file.txt', path.basename(files[0])); | ||
assert.strictEqual('folder2', path.dirname(files[1])); | ||
assert.strictEqual('file.pdf', path.basename(files[1])); | ||
cb(); | ||
}).fail(function(message){ | ||
assert(false, message); | ||
cb(); | ||
}); | ||
cb(); | ||
jsb3('testfiles/file2.jsb3').then(function(files){ | ||
assert.equal(files.length, 2); | ||
assert.strictEqual('folder1', path.dirname(files[0])); | ||
assert.strictEqual('file.txt', path.basename(files[0])); | ||
assert.strictEqual('folder2', path.dirname(files[1])); | ||
assert.strictEqual('file.pdf', path.basename(files[1])); | ||
cb(); | ||
}).fail(function(message){ | ||
assert(false, message); | ||
cb(); | ||
}); | ||
cb(); | ||
}); |
Sorry, the diff of this file is not supported yet
6651
-1.67%