Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server tests in Node v15 #5652

Merged
merged 4 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"source-map-support": "^0.5.16",
"strip-bom": "^2.0.0",
"testcafe-browser-tools": "2.0.13",
"testcafe-hammerhead": "17.1.20",
"testcafe-hammerhead": "17.1.23",
"testcafe-legacy-api": "4.0.0",
"testcafe-reporter-json": "^2.1.0",
"testcafe-reporter-list": "^2.1.0",
Expand Down
4 changes: 3 additions & 1 deletion src/errors/create-stack-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const TESTCAFE_HAMMERHEAD = `${sep}testcafe-hammerhead${sep}`;

const SOURCE_MAP_SUPPORT = `${sep}source-map-support${sep}`;

const INTERNAL = 'internal/';
const INTERNAL = 'internal/';
const INTERNAL_PREFIX_IN_NODE_15 = 'node:';

export default function createStackFilter (limit) {
let passedFramesCount = 0;
Expand All @@ -31,6 +32,7 @@ export default function createStackFilter (limit) {
const pass = filename &&
filename.indexOf(sep) > -1 &&
filename.indexOf(INTERNAL) !== 0 &&
filename.indexOf(INTERNAL_PREFIX_IN_NODE_15) !== 0 &&
filename.indexOf(TESTCAFE_LIB) !== 0 &&
filename.indexOf(TESTCAFE_BIN) !== 0 &&
filename.indexOf(TESTCAFE_HAMMERHEAD) < 0 &&
Expand Down
4 changes: 3 additions & 1 deletion src/errors/process-test-fn-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
} from './test-run';


const INTERNAL = 'internal/';
const INTERNAL = 'internal/';
const INTERNAL_PREFIX_IN_NODE_15 = 'node:';

function isAssertionErrorCallsiteFrame (frame) {
const filename = frame.getFileName();
Expand All @@ -19,6 +20,7 @@ function isAssertionErrorCallsiteFrame (frame) {
return filename &&
filename.indexOf(sep) > -1 &&
filename.indexOf(INTERNAL) !== 0 &&
filename.indexOf(INTERNAL_PREFIX_IN_NODE_15) !== 0 &&
filename.indexOf(`${sep}node_modules${sep}`) < 0;
}

Expand Down
1 change: 1 addition & 0 deletions test/server/helpers/assert-runtime-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function assertStack (err, expected) {
parsedStack.forEach(function (frame, idx) {
const filename = frame.fileName;
const isInternal = frame.fileName.indexOf('internal/') === 0 ||
frame.fileName.indexOf('node:') === 0 &&
frame.fileName.indexOf(sep) < 0;

// NOTE: assert that stack is clean from internals
Expand Down