Skip to content

Commit

Permalink
Fix engines.test.js for multiple potential versions (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Jul 5, 2023
1 parent 3918f35 commit 07bbd42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion __tests__/engines.test.js
Expand Up @@ -15,6 +15,10 @@ describe('engines.node', () => {
]).toString(),
);

expect(nodeVersion).toEqual(pkg.engines.node);
// `^x.y.z` range can return multiple versions.
const nodeVersions = Array.isArray(nodeVersion) ? [...new Set(nodeVersion)] : [nodeVersion];

expect(nodeVersions).toHaveLength(1);
expect(nodeVersions).toContain(pkg.engines.node);
});
});

0 comments on commit 07bbd42

Please sign in to comment.