Switch unzip test dependency for Node 10 support

This commit is contained in:
Lovell Fuller 2018-04-25 20:37:10 +01:00
parent 165e337e44
commit 6d2da2b3ba
2 changed files with 13 additions and 17 deletions

View File

@ -94,6 +94,7 @@
"devDependencies": { "devDependencies": {
"async": "^2.6.0", "async": "^2.6.0",
"cc": "^1.0.2", "cc": "^1.0.2",
"decompress-zip": "^0.3.1",
"documentation": "^6.2.0", "documentation": "^6.2.0",
"exif-reader": "^1.0.2", "exif-reader": "^1.0.2",
"icc": "^1.0.0", "icc": "^1.0.0",
@ -102,8 +103,7 @@
"prebuild": "^7.4.0", "prebuild": "^7.4.0",
"prebuild-ci": "^2.2.3", "prebuild-ci": "^2.2.3",
"rimraf": "^2.6.2", "rimraf": "^2.6.2",
"semistandard": "^12.0.1", "semistandard": "^12.0.1"
"unzip": "^0.1.11"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"config": { "config": {

View File

@ -6,7 +6,7 @@ const assert = require('assert');
const eachLimit = require('async/eachLimit'); const eachLimit = require('async/eachLimit');
const rimraf = require('rimraf'); const rimraf = require('rimraf');
const unzip = require('unzip'); const DecompressZip = require('decompress-zip');
const sharp = require('../../'); const sharp = require('../../');
const fixtures = require('../fixtures'); const fixtures = require('../fixtures');
@ -427,16 +427,14 @@ describe('Tile', function () {
if (err) throw err; if (err) throw err;
assert.strictEqual(true, stat.isFile()); assert.strictEqual(true, stat.isFile());
assert.strictEqual(true, stat.size > 0); assert.strictEqual(true, stat.size > 0);
fs.createReadStream(container) new DecompressZip(container)
.pipe(unzip.Extract({ .on('extract', function () {
path: path.dirname(extractTo) assertDeepZoomTiles(directory, 256, 13, done);
})) })
.on('error', function (err) { .on('error', function (err) {
throw err; throw err;
}) })
.on('close', function () { .extract({ path: path.dirname(extractTo) });
assertDeepZoomTiles(directory, 256, 13, done);
});
}); });
}); });
}); });
@ -463,16 +461,14 @@ describe('Tile', function () {
if (err) throw err; if (err) throw err;
assert.strictEqual(true, stat.isFile()); assert.strictEqual(true, stat.isFile());
assert.strictEqual(true, stat.size > 0); assert.strictEqual(true, stat.size > 0);
fs.createReadStream(container) new DecompressZip(container)
.pipe(unzip.Extract({ .on('extract', function () {
path: path.dirname(extractTo) assertDeepZoomTiles(directory, 256, 13, done);
})) })
.on('error', function (err) { .on('error', function (err) {
throw err; throw err;
}) })
.on('close', function () { .extract({ path: path.dirname(extractTo) });
assertDeepZoomTiles(directory, 256, 13, done);
});
}); });
}); });
}); });