mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure SHARP_FORCE_GLOBAL_LIBVIPS option works correctly #4111
Allows the install/check script to inject a logger function, keeping its use within binding.gyp free of additional output. Co-authored-by: Lovell Fuller <github@lovell.info>
This commit is contained in:
committed by
Lovell Fuller
parent
cc96c21e42
commit
56fae3eda1
@@ -72,6 +72,15 @@ describe('libvips binaries', function () {
|
||||
const useGlobalLibvips = libvips.useGlobalLibvips();
|
||||
assert.strictEqual(true, useGlobalLibvips);
|
||||
|
||||
let logged = false;
|
||||
const logger = function (message) {
|
||||
assert.strictEqual(message, 'Detected SHARP_FORCE_GLOBAL_LIBVIPS, skipping search for globally-installed libvips');
|
||||
logged = true;
|
||||
};
|
||||
const useGlobalLibvipsWithLogger = libvips.useGlobalLibvips(logger);
|
||||
assert.strictEqual(true, useGlobalLibvipsWithLogger);
|
||||
assert.strictEqual(true, logged);
|
||||
|
||||
delete process.env.SHARP_FORCE_GLOBAL_LIBVIPS;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user