From b65ea2aa6760b0306783fe036442bd5723523141 Mon Sep 17 00:00:00 2001 From: Dzmitry Kosarau Date: Fri, 13 Oct 2023 18:05:03 +0500 Subject: [PATCH] EPMRPP-8583 || fix issue with webdriverio + mocha in it.skip - Add prettierignore - Bump client js version - Update GH token --- .github/workflows/publish.yml | 2 +- .prettierignore | 2 ++ CHANGELOG.md | 4 +++ package-lock.json | 51 +++++++++++++++++--------------- package.json | 2 +- src/__tests__/finishTest.spec.ts | 3 ++ src/reporter.ts | 1 + 7 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 .prettierignore diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 13fba27..f5f5842 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -71,4 +71,4 @@ jobs: npm config list npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..47cf186 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +# Ignore all .md files +*.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c4aa7..937dcf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### Fixed +- Reporter breaks on skipped test for WebdriverIO + Mocha - [#46](https://github.com/reportportal/agent-js-webdriverio/issues/46) +### Updated +- `@reportportal/client-javascript` bumped to version `5.0.14` ### Added - Browser parameter to steps diff --git a/package-lock.json b/package-lock.json index 1220a7e..3c13515 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "5.0.3", "license": "Apache-2.0", "dependencies": { - "@reportportal/client-javascript": "^5.0.8", + "@reportportal/client-javascript": "^5.0.14", "@wdio/reporter": "^7.29.1", "json-stringify-safe": "^5.0.1" }, @@ -1102,18 +1102,19 @@ } }, "node_modules/@reportportal/client-javascript": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.0.8.tgz", - "integrity": "sha512-uk+6liESB7bC585K3z51IaBwWzU6tyHkOYmEHngOFMAK+G6UImzyl2g3A2cqdQMKDbd0jaTGtnfw0kmOey23WQ==", + "version": "5.0.14", + "resolved": "https://registry.npmjs.org/@reportportal/client-javascript/-/client-javascript-5.0.14.tgz", + "integrity": "sha512-4ge9ddOB1rFlzqI6j43qCw0cyjQOloiPChA1EFyF3dcV2BXHzGbh8S3SNhwxibvlQtV6piU8e0W9CLN4UWXvSA==", "dependencies": { "axios": "^0.27.2", - "axios-retry": "^3.2.4", - "glob": "^7.2.0", + "axios-retry": "^3.4.0", + "glob": "^7.2.3", + "ini": "^2.0.0", "uniqid": "^5.4.0", - "universal-analytics": "^0.5.3" + "uuid": "^9.0.0" }, "engines": { - "node": ">= 10.0.0" + "node": ">=10.x" } }, "node_modules/@sindresorhus/is": { @@ -2307,6 +2308,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -3916,6 +3918,14 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "engines": { + "node": ">=10" + } + }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -5297,7 +5307,8 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/natural-compare": { "version": "1.4.0", @@ -6690,18 +6701,6 @@ "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-5.4.0.tgz", "integrity": "sha512-38JRbJ4Fj94VmnC7G/J/5n5SC7Ab46OM5iNtSstB/ko3l1b5g7ALt4qzHFgGciFkyiRNtDXtLNb+VsxtMSE77A==" }, - "node_modules/universal-analytics": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/universal-analytics/-/universal-analytics-0.5.3.tgz", - "integrity": "sha512-HXSMyIcf2XTvwZ6ZZQLfxfViRm/yTGoRgDeTbojtq6rezeyKB0sTBcKH2fhddnteAHRcHiKgr/ACpbgjGOC6RQ==", - "dependencies": { - "debug": "^4.3.1", - "uuid": "^8.0.0" - }, - "engines": { - "node": ">=12.18.2" - } - }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -6756,9 +6755,13 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } diff --git a/package.json b/package.json index bc09c1d..71728f2 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test:coverage": "jest --coverage" }, "dependencies": { - "@reportportal/client-javascript": "^5.0.8", + "@reportportal/client-javascript": "^5.0.14", "@wdio/reporter": "^7.29.1", "json-stringify-safe": "^5.0.1" }, diff --git a/src/__tests__/finishTest.spec.ts b/src/__tests__/finishTest.spec.ts index 0700a4e..66a725a 100644 --- a/src/__tests__/finishTest.spec.ts +++ b/src/__tests__/finishTest.spec.ts @@ -127,9 +127,12 @@ describe('finishing test reporting', () => { title: testName, state: 'skipped', }; + reporter.onTestStart = jest.fn(); reporter.onTestSkip(testStats); + expect(reporter.onTestStart).toHaveBeenCalledTimes(1); + expect(reporter.onTestStart).toHaveBeenCalledWith(testStats); expect(spyOnFinishTest).toBeCalledTimes(1); expect(spyOnFinishTest).toBeCalledWith(testStats); }); diff --git a/src/reporter.ts b/src/reporter.ts index fb08254..b89b805 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -163,6 +163,7 @@ export class Reporter extends WDIOReporter { } onTestSkip(testStats: TestStats): void { + this.onTestStart(testStats); this.finishTest(testStats); }