Allow yarn locator hash calc to fail e.g. Windows

This commit is contained in:
Lovell Fuller
2023-12-10 19:51:21 +00:00
parent 1592f96b7b
commit a584ae093e
2 changed files with 11 additions and 5 deletions

View File

@@ -147,7 +147,9 @@ describe('libvips binaries', function () {
it('yarn locator hash', () => {
const locatorHash = libvips.yarnLocator();
assert.strictEqual(locatorHash.length, 10);
assert.strict(/[a-f0-9]{10}/.test(locatorHash));
if (locatorHash.length) {
assert.strict(locatorHash.length, 10);
assert.strict(/[a-f0-9]{10}/.test(locatorHash));
}
});
});