Skip to content

Commit

Permalink
preserve-symlinks{-main} flags (#3900)
Browse files Browse the repository at this point in the history
Update unit test for Node-12 compatibility.
  • Loading branch information
juergba authored and plroebuck committed May 8, 2019
1 parent aed20bd commit 9b00fed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/node-unit/cli/node-flags.spec.js
Expand Up @@ -35,9 +35,12 @@ describe('node-flags', function() {
it('should return true for flags starting with "preserve-symlinks"', function() {
expect(isNodeFlag('preserve-symlinks'), 'to be true');
expect(isNodeFlag('preserve-symlinks-main'), 'to be true');
// XXX this is not true in some newer versions of Node.js. figure out where
// this changed.
expect(isNodeFlag('preserve_symlinks'), 'to be false');
// Node >= v12 both flags exist in process.allowedNodeEnvironmentFlags
const nodeVersion = parseInt(process.version.match(/^v(\d+)\./)[1], 10);
expect(
isNodeFlag('preserve_symlinks'),
nodeVersion >= 12 ? 'to be true' : 'to be false'
);
});

it('should return true for flags starting with "harmony-" or "harmony_"', function() {
Expand Down

0 comments on commit 9b00fed

Please sign in to comment.