Skip to content

Commit

Permalink
Agregando pruebas para extract-zip
Browse files Browse the repository at this point in the history
extract-zip tiene una regresión horrible en la versión 1.6.1.
  • Loading branch information
lhchavez committed Apr 30, 2017
1 parent 7e31763 commit 9e91142
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"jison": "^0.4.17",
"mocha": "^3.3.0",
"shebang-loader": "0.0.1",
"tmp": "0.0.31",
"webpack": "^2.4.1"
}
}
25 changes: 25 additions & 0 deletions test/extractzip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const assert = require('assert');
const extract = require('extract-zip')
const fs = require('fs');
const tmp = require('tmp');

describe('extract-zip', function() {
var dir = null;

beforeEach(function() {
dir = tmp.dirSync({unsafeCleanup: true});
});

afterEach(function() {
dir.removeCallback();
dir = null;
});

it('should not crash with intermediate directories', function(done) {
extract('./test/test.zip', {dir: dir.name}, function(err) {
assert.ifError(err);
assert.ok(fs.existsSync(dir.name + '/nested/file'));
done();
});
});
});
Binary file added test/test.zip
Binary file not shown.

0 comments on commit 9e91142

Please sign in to comment.