From 4e6ef6e63735ea7afd54203a99f1c4c68e734b24 Mon Sep 17 00:00:00 2001 From: Pavel Redrukhin Date: Thu, 22 Oct 2020 13:11:01 +0300 Subject: [PATCH 1/4] Trying to fix tests after upgrading to Node 15 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e1e89d34182..5e59ebf640d 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "main": "lib/index", "types": "ts-defs/index.d.ts", "bin": { - "testcafe": "./bin/testcafe-with-v8-flag-filter.js" + "testcafe": "bin/testcafe-with-v8-flag-filter.js" }, "files": [ "lib", From 60c89baa5095a00e4ddf78672434d78d2f3f534f Mon Sep 17 00:00:00 2001 From: Pavel Redrukhin Date: Thu, 22 Oct 2020 18:09:58 +0300 Subject: [PATCH 2/4] Add prefix of internal files introduced in Node15 --- package.json | 2 +- src/errors/create-stack-filter.js | 4 +++- src/errors/process-test-fn-error.js | 4 +++- test/server/helpers/assert-runtime-error.js | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5e59ebf640d..e1e89d34182 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "main": "lib/index", "types": "ts-defs/index.d.ts", "bin": { - "testcafe": "bin/testcafe-with-v8-flag-filter.js" + "testcafe": "./bin/testcafe-with-v8-flag-filter.js" }, "files": [ "lib", diff --git a/src/errors/create-stack-filter.js b/src/errors/create-stack-filter.js index 54c65dece43..91f1ac7b831 100644 --- a/src/errors/create-stack-filter.js +++ b/src/errors/create-stack-filter.js @@ -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; @@ -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 && diff --git a/src/errors/process-test-fn-error.js b/src/errors/process-test-fn-error.js index ed05c647a48..825d28b004f 100644 --- a/src/errors/process-test-fn-error.js +++ b/src/errors/process-test-fn-error.js @@ -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(); @@ -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; } diff --git a/test/server/helpers/assert-runtime-error.js b/test/server/helpers/assert-runtime-error.js index b5a228a6703..f0e7fb2ddee 100644 --- a/test/server/helpers/assert-runtime-error.js +++ b/test/server/helpers/assert-runtime-error.js @@ -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 From c30ab59ea39326ef0da8f7c5cf09720d70edd54a Mon Sep 17 00:00:00 2001 From: MargaritaLoseva Date: Mon, 26 Oct 2020 09:50:36 +0300 Subject: [PATCH 3/4] fix test in firefox --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e1e89d34182..994eea1e523 100644 --- a/package.json +++ b/package.json @@ -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": "/~https://github.com/miherlosev/tmp/files/5437234/testcafe-hammerhead-17.1.23.zip", "testcafe-legacy-api": "4.0.0", "testcafe-reporter-json": "^2.1.0", "testcafe-reporter-list": "^2.1.0", From 242021fd81ea9560d27977c9d4a15a71c4d987ee Mon Sep 17 00:00:00 2001 From: miherlosev Date: Mon, 26 Oct 2020 10:40:12 +0300 Subject: [PATCH 4/4] update hammerhead --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 994eea1e523..72e59ac74af 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "source-map-support": "^0.5.16", "strip-bom": "^2.0.0", "testcafe-browser-tools": "2.0.13", - "testcafe-hammerhead": "/~https://github.com/miherlosev/tmp/files/5437234/testcafe-hammerhead-17.1.23.zip", + "testcafe-hammerhead": "17.1.23", "testcafe-legacy-api": "4.0.0", "testcafe-reporter-json": "^2.1.0", "testcafe-reporter-list": "^2.1.0",