mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Cache libvips binaries to reduce re-install time #1301
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
const semver = require('semver');
|
||||
const libvips = require('../../lib/libvips');
|
||||
|
||||
@@ -66,5 +67,11 @@ describe('libvips binaries', function () {
|
||||
|
||||
delete process.env.SHARP_IGNORE_GLOBAL_LIBVIPS;
|
||||
});
|
||||
it('cachePath returns a valid path ending with _libvips', function () {
|
||||
const cachePath = libvips.cachePath();
|
||||
assert.strictEqual('string', typeof cachePath);
|
||||
assert.strictEqual('_libvips', cachePath.substr(-8));
|
||||
assert.strictEqual(true, fs.existsSync(cachePath));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user