Skip to content

Commit 9fbf004

Browse files
committed
[Tests] skip tests that crash in node < 14
1 parent 9d85092 commit 9fbf004

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-assert-checktag.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
const {isBrowser} = require('../common');
1010
const assert = require('../../assert');
1111

12+
const isNode14 = process.versions.node.indexOf('.') > 1 && process.versions.node.slice(0, 2) >= 14;
13+
1214
// Disable colored output to prevent color codes from breaking assertion
1315
// message comparisons. This should only be an issue when process.stdout
1416
// is a TTY.
1517
if (process.stdout && process.stdout.isTTY)
1618
process.env.NODE_DISABLE_COLORS = '1';
1719

1820
// Turn off no-restricted-properties because we are testing deepEqual!
19-
/* eslint-disable no-restricted-properties */
21+
2022

2123
// See https://github.com/nodejs/node/issues/10258
2224
{
@@ -46,7 +48,7 @@ if (process.stdout && process.stdout.isTTY)
4648
);
4749
}
4850

49-
if (!isBrowser) { // At the moment global has its own type tag
51+
if (!isBrowser && isNode14) { // At the moment global has its own type tag
5052
const fakeGlobal = {};
5153
Object.setPrototypeOf(fakeGlobal, Object.getPrototypeOf(global));
5254
Object.keys(global).forEach(prop => {
@@ -59,7 +61,7 @@ if (!isBrowser) { // At the moment global has its own type tag
5961
}
6062

6163

62-
if (!isBrowser) { // At the moment process has its own type tag
64+
if (!isBrowser && isNode14) { // At the moment process has its own type tag
6365
const fakeProcess = {};
6466
Object.setPrototypeOf(fakeProcess, Object.getPrototypeOf(process));
6567
Object.keys(process).forEach(prop => {

0 commit comments

Comments
 (0)