From 25164d4cefd013be40917ab4a34c02ce8c7c4ba8 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 11 Dec 2023 21:51:20 +0000 Subject: [PATCH] Tests: tighten yarn locator test for multi-platform --- test/unit/libvips.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unit/libvips.js b/test/unit/libvips.js index dee38d175..3e013518f 100644 --- a/test/unit/libvips.js +++ b/test/unit/libvips.js @@ -147,20 +147,23 @@ describe('libvips binaries', function () { describe('yarn locator hash', () => { it('known platform', () => { + const cc = process.env.CC; + delete process.env.CC; process.env.npm_config_platform = 'linux'; process.env.npm_config_arch = 's390x'; + process.env.npm_config_libc = ''; const locatorHash = libvips.yarnLocator(); assert.strictEqual(locatorHash, '86cc8ee6e4'); delete process.env.npm_config_platform; delete process.env.npm_config_arch; + delete process.env.npm_config_libc; + process.env.CC = cc; }); it('unknown platform', () => { process.env.npm_config_platform = 'unknown-platform'; - process.env.npm_config_arch = 'unknown-arch'; const locatorHash = libvips.yarnLocator(); assert.strictEqual(locatorHash, ''); delete process.env.npm_config_platform; - delete process.env.npm_config_arch; }); }); });