diff --git a/package.json b/package.json index c96d766c..2a185e32 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "devDependencies": { "async": "^2.6.0", "cc": "^1.0.2", + "decompress-zip": "^0.3.1", "documentation": "^6.2.0", "exif-reader": "^1.0.2", "icc": "^1.0.0", @@ -102,8 +103,7 @@ "prebuild": "^7.4.0", "prebuild-ci": "^2.2.3", "rimraf": "^2.6.2", - "semistandard": "^12.0.1", - "unzip": "^0.1.11" + "semistandard": "^12.0.1" }, "license": "Apache-2.0", "config": { diff --git a/test/unit/tile.js b/test/unit/tile.js index 7fd138c0..1bbcf953 100644 --- a/test/unit/tile.js +++ b/test/unit/tile.js @@ -6,7 +6,7 @@ const assert = require('assert'); const eachLimit = require('async/eachLimit'); const rimraf = require('rimraf'); -const unzip = require('unzip'); +const DecompressZip = require('decompress-zip'); const sharp = require('../../'); const fixtures = require('../fixtures'); @@ -427,16 +427,14 @@ describe('Tile', function () { if (err) throw err; assert.strictEqual(true, stat.isFile()); assert.strictEqual(true, stat.size > 0); - fs.createReadStream(container) - .pipe(unzip.Extract({ - path: path.dirname(extractTo) - })) + new DecompressZip(container) + .on('extract', function () { + assertDeepZoomTiles(directory, 256, 13, done); + }) .on('error', function (err) { throw err; }) - .on('close', function () { - assertDeepZoomTiles(directory, 256, 13, done); - }); + .extract({ path: path.dirname(extractTo) }); }); }); }); @@ -463,16 +461,14 @@ describe('Tile', function () { if (err) throw err; assert.strictEqual(true, stat.isFile()); assert.strictEqual(true, stat.size > 0); - fs.createReadStream(container) - .pipe(unzip.Extract({ - path: path.dirname(extractTo) - })) + new DecompressZip(container) + .on('extract', function () { + assertDeepZoomTiles(directory, 256, 13, done); + }) .on('error', function (err) { throw err; }) - .on('close', function () { - assertDeepZoomTiles(directory, 256, 13, done); - }); + .extract({ path: path.dirname(extractTo) }); }); }); });