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

@@ -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) });
});
});
});