Skip to content

Commit

Permalink
Tests: tighten yarn locator test for multi-platform
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Dec 11, 2023
1 parent 516b1ec commit 25164d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/unit/libvips.js
Expand Up @@ -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;
});
});
});

0 comments on commit 25164d4

Please sign in to comment.