From 32f18a15368b379fc45788d70c8b72b46716861c Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Mon, 3 Mar 2025 05:59:58 +0100 Subject: [PATCH 1/6] Bump @codeceptjs/expect-helper to ^1.0.0 --- package.json | 2 +- .../custom-reporter-plugin/output/result.json | 67 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 test/data/sandbox/configs/custom-reporter-plugin/output/result.json diff --git a/package.json b/package.json index e47101671..bdd26504c 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ }, "devDependencies": { "@apollo/server": "^4", - "@codeceptjs/expect-helper": "^0.2.2", + "@codeceptjs/expect-helper": "^1.0.0", "@codeceptjs/mock-request": "0.3.1", "@eslint/eslintrc": "3.2.0", "@eslint/js": "9.19.0", diff --git a/test/data/sandbox/configs/custom-reporter-plugin/output/result.json b/test/data/sandbox/configs/custom-reporter-plugin/output/result.json new file mode 100644 index 000000000..ba482d9a1 --- /dev/null +++ b/test/data/sandbox/configs/custom-reporter-plugin/output/result.json @@ -0,0 +1,67 @@ +{ + "hasFailed": true, + "stats": { + "passes": 0, + "failures": 1, + "tests": 1, + "pending": 0, + "failedHooks": 0, + "start": "2025-03-03T04:55:55.785Z", + "end": "2025-03-03T04:55:55.796Z", + "duration": 11 + }, + "duration": 21, + "tests": [ + { + "opts": {}, + "tags": [], + "uid": "7NxSU6hWX0tj5d6GGxCtwSpDCOTsK3ggAD33fv7kzE", + "retries": -1, + "title": "test custom-reporter-plugin", + "state": "failed", + "notes": [], + "meta": {}, + "artifacts": [], + "duration": 1, + "err": { + "stack": "AssertionError [ERR_ASSERTION]: \n at FileSystem.seeFile (/Volumes/dev/external-repos/CodeceptJS/lib/helper/FileSystem.js:70:12)\n at HelperStep.run (/Volumes/dev/external-repos/CodeceptJS/lib/step/helper.js:28:49)\n\n\n◯ File: /Volumes/dev/external-repos/CodeceptJS/test/data/sandbox/configs/custom-reporter-plugin/custom-reporter-plugin_test.js\n\n◯ Scenario Steps:\n✖ I.seeFile(\"this-file-should-not-exist.txt\") at Test. (./custom-reporter-plugin_test.js:13:5)\n✔ I.amInPath(\".\") at Test. (./custom-reporter-plugin_test.js:12:5)\n", + "message": "\n File this-file-should-not-exist.txt not found in /Volumes/dev/external-repos/CodeceptJS/test/data/sandbox/configs/custom-reporter-plugin", + "actual": "false", + "expected": "true" + }, + "parent": { + "title": "custom-reporter-plugin" + }, + "steps": [ + { + "opts": {}, + "title": "seeFile", + "args": ["this-file-should-not-exist.txt"], + "status": "failed", + "startTime": 1740977755792, + "endTime": 1740977755793, + "parent": {} + }, + { + "opts": {}, + "title": "amInPath", + "args": ["."], + "status": "success", + "startTime": 1740977755792, + "endTime": 1740977755792, + "parent": {} + } + ] + } + ], + "failures": [ + [], + [ + " %s) %s:\n%s\n%s\n", + 1, + "custom-reporter-plugin\n test custom-reporter-plugin", + "\n \n File this-file-should-not-exist.txt not found in /Volumes/dev/external-repos/CodeceptJS/test/data/sandbox/configs/custom-reporter-plugin\n + expected - actual\n\n -false\n +true\n ", + " AssertionError [ERR_ASSERTION]: \n at FileSystem.seeFile (/Volumes/dev/external-repos/CodeceptJS/lib/helper/FileSystem.js:70:12)\n at HelperStep.run (/Volumes/dev/external-repos/CodeceptJS/lib/step/helper.js:28:49)\n \n \n ◯ File: /Volumes/dev/external-repos/CodeceptJS/test/data/sandbox/configs/custom-reporter-plugin/custom-reporter-plugin_test.js\n \n ◯ Scenario Steps:\n ✖ I.seeFile(\"this-file-should-not-exist.txt\") at Test. (./custom-reporter-plugin_test.js:13:5)\n ✔ I.amInPath(\".\") at Test. (./custom-reporter-plugin_test.js:12:5)\n " + ] + ] +} From c3fb289daa8330bdf76793f1521b34c9afa1b3ae Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Tue, 11 Mar 2025 11:35:42 +0100 Subject: [PATCH 2/6] tryout --- test/acceptance/codecept.Playwright.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/acceptance/codecept.Playwright.js b/test/acceptance/codecept.Playwright.js index 7c5eb2f82..696fcfbab 100644 --- a/test/acceptance/codecept.Playwright.js +++ b/test/acceptance/codecept.Playwright.js @@ -23,7 +23,9 @@ module.exports.config = { require: '../support/ScreenshotSessionHelper.js', outputPath: 'test/acceptance/output', }, - '@codeceptjs/expect-helper': {}, + Expect: { + require: '@codeceptjs/expect-helper', + }, }, include: {}, bootstrap: false, From dc4eaf8276f87f915735654757ec343f82d58aba Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Tue, 11 Mar 2025 13:14:53 +0100 Subject: [PATCH 3/6] Require js file --- test/acceptance/codecept.Playwright.coverage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acceptance/codecept.Playwright.coverage.js b/test/acceptance/codecept.Playwright.coverage.js index 3a88f19ee..937ee2e8e 100644 --- a/test/acceptance/codecept.Playwright.coverage.js +++ b/test/acceptance/codecept.Playwright.coverage.js @@ -24,7 +24,7 @@ module.exports.config = { outputPath: 'test/acceptance/output', }, Expect: { - require: '@codeceptjs/expect-helper', + require: '@codeceptjs/expect-helper/index.js', }, }, include: {}, From b4d36f9866a5ce2087fdb7c392f3b754297591bd Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Tue, 11 Mar 2025 13:20:19 +0100 Subject: [PATCH 4/6] Use .cjs --- test/acceptance/codecept.Playwright.coverage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acceptance/codecept.Playwright.coverage.js b/test/acceptance/codecept.Playwright.coverage.js index 937ee2e8e..fa43f8c2e 100644 --- a/test/acceptance/codecept.Playwright.coverage.js +++ b/test/acceptance/codecept.Playwright.coverage.js @@ -24,7 +24,7 @@ module.exports.config = { outputPath: 'test/acceptance/output', }, Expect: { - require: '@codeceptjs/expect-helper/index.js', + require: '@codeceptjs/expect-helper/index.cjs', }, }, include: {}, From dc9c9c26190c837887a52f51b5e8537877f51e6a Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Tue, 11 Mar 2025 13:25:13 +0100 Subject: [PATCH 5/6] Use import? --- test/acceptance/codecept.Playwright.coverage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acceptance/codecept.Playwright.coverage.js b/test/acceptance/codecept.Playwright.coverage.js index fa43f8c2e..26381ecff 100644 --- a/test/acceptance/codecept.Playwright.coverage.js +++ b/test/acceptance/codecept.Playwright.coverage.js @@ -24,7 +24,7 @@ module.exports.config = { outputPath: 'test/acceptance/output', }, Expect: { - require: '@codeceptjs/expect-helper/index.cjs', + import: '@codeceptjs/expect-helper/index.cjs', }, }, include: {}, From 6d5209ebf736d76780d939704e6bf5a1572d1820 Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Tue, 11 Mar 2025 13:30:43 +0100 Subject: [PATCH 6/6] Back to square 1 --- test/acceptance/codecept.Playwright.coverage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/acceptance/codecept.Playwright.coverage.js b/test/acceptance/codecept.Playwright.coverage.js index 26381ecff..3a88f19ee 100644 --- a/test/acceptance/codecept.Playwright.coverage.js +++ b/test/acceptance/codecept.Playwright.coverage.js @@ -24,7 +24,7 @@ module.exports.config = { outputPath: 'test/acceptance/output', }, Expect: { - import: '@codeceptjs/expect-helper/index.cjs', + require: '@codeceptjs/expect-helper', }, }, include: {},