Skip to content

Commit

Permalink
fix: test less than node 10
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Feb 6, 2024
1 parent 907d706 commit cc3eb75
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/regex-features.js
Expand Up @@ -25,9 +25,10 @@ describe('regex features', () => {
});

it('should throw an error when regex lookbehinds are used on an unsupported node version', () => {
Reflect.defineProperty(process, 'version', { value: 'v6.0.0' });
assert.throws(() => isMatch('foo/cbaz', 'foo/*(?<!c)baz'), /Node\.js v10 or higher/);
Reflect.defineProperty(process, 'version', { value: version });
const nodeMajor = process.versions.node.split('.')[0];
if (nodeMajor < 10) {
assert.throws(() => isMatch('foo/cbaz', 'foo/*(?<!c)baz'), /Node\.js v10 or higher/);
}
});
});

Expand Down

0 comments on commit cc3eb75

Please sign in to comment.