Skip to content

Commit

Permalink
[Tests] skip tests that crash in node < 14
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 7, 2023
1 parent 9d85092 commit 2a19825
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-assert-checktag.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
const {isBrowser} = require('../common');
const assert = require('../../assert');

const isNode14 = process.versions.node.indexOf('.') > 1 && process.versions.node.slice(0, 2) >= 14;

// Disable colored output to prevent color codes from breaking assertion
// message comparisons. This should only be an issue when process.stdout
// is a TTY.
if (process.stdout && process.stdout.isTTY)
process.env.NODE_DISABLE_COLORS = '1';

// Turn off no-restricted-properties because we are testing deepEqual!
/* eslint-disable no-restricted-properties */


// See https://github.com/nodejs/node/issues/10258
{
Expand Down Expand Up @@ -46,7 +48,7 @@ if (process.stdout && process.stdout.isTTY)
);
}

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


if (!isBrowser) { // At the moment process has its own type tag
if (!isBrowser && isNode14) { // At the moment process has its own type tag
const fakeProcess = {};
Object.setPrototypeOf(fakeProcess, Object.getPrototypeOf(process));
Object.keys(process).forEach(prop => {
Expand Down

0 comments on commit 2a19825

Please sign in to comment.