diff --git a/package-lock.json b/package-lock.json index bfd9aa34..38139ee6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,9 +20,6 @@ "qase-mocha", "./examples/*" ], - "dependencies": { - "mocha": "^10.6.0" - }, "devDependencies": { "@jest/globals": "^29.5.0", "@types/jest": "^29.5.2", @@ -32,6 +29,7 @@ "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-import": "^2.27.5", "jest": "^29.5.0", + "mocha": "^10.6.0", "prettier": "^2.8.8", "ts-jest": "^29.1.0", "typescript": "^5.4.5" @@ -57,6 +55,47 @@ "eslint-plugin-cypress": "^2.13.3" } }, + "examples/cypress/node_modules/cypress-qase-reporter": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/cypress-qase-reporter/-/cypress-qase-reporter-2.0.3.tgz", + "integrity": "sha512-+k596UDrZ0Z0oq6xtWkqjDp0Kg3lS4PhY49uij8y6zBECF2PyI20CQd8uJb+wL9BNxVojK7bczoJ1oCbVZwKAg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "qase-javascript-commons": "^2.0.0", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "cypress": ">=8.0.0" + } + }, + "examples/cypress/node_modules/qase-javascript-commons": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/qase-javascript-commons/-/qase-javascript-commons-2.0.13.tgz", + "integrity": "sha512-ER+q5kTrevo8jKzoHPDeFUOzdDt7ZLqL1ek6Py6oGlR5VnJRZegSt/BfJvXhbFcn2PLa5si/vaNSr/rnGhbF8Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "ajv": "^8.12.0", + "chalk": "^4.1.2", + "child-process-ext": "^3.0.2", + "env-schema": "^5.2.0", + "form-data": "^4.0.0", + "lodash.get": "^4.4.2", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "mime-types": "^2.1.33", + "qaseio": "~2.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "examples/jest": { "name": "examples-jest", "devDependencies": { @@ -71,7 +110,7 @@ "name": "examples-mocha", "devDependencies": { "mocha": "^10.2.0", - "mocha-qase-reporter": "^1.0.0" + "mocha-qase-reporter": "^1.0.0-beta.1" } }, "examples/newman": { @@ -2102,7 +2141,6 @@ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "optional": true, - "peer": true, "engines": { "node": ">=0.1.90" } @@ -3527,7 +3565,6 @@ "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "optional": true, - "peer": true, "dependencies": { "@types/node": "*" } @@ -15065,12 +15102,35 @@ "@cucumber/cucumber": ">=7.0.0" } }, + "qase-cucumberjs/node_modules/qase-javascript-commons": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/qase-javascript-commons/-/qase-javascript-commons-2.0.13.tgz", + "integrity": "sha512-ER+q5kTrevo8jKzoHPDeFUOzdDt7ZLqL1ek6Py6oGlR5VnJRZegSt/BfJvXhbFcn2PLa5si/vaNSr/rnGhbF8Q==", + "license": "Apache-2.0", + "dependencies": { + "ajv": "^8.12.0", + "chalk": "^4.1.2", + "child-process-ext": "^3.0.2", + "env-schema": "^5.2.0", + "form-data": "^4.0.0", + "lodash.get": "^4.4.2", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "mime-types": "^2.1.33", + "qaseio": "~2.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "qase-cypress": { "name": "cypress-qase-reporter", - "version": "2.0.2", + "version": "2.1.0-beta.1", "license": "Apache-2.0", "dependencies": { - "qase-javascript-commons": "^2.0.0", + "qase-javascript-commons": "~2.1.0-beta.1", "uuid": "^9.0.1" }, "devDependencies": { @@ -15090,7 +15150,7 @@ } }, "qase-javascript-commons": { - "version": "2.0.11", + "version": "2.1.0-beta.1", "license": "Apache-2.0", "dependencies": { "ajv": "^8.12.0", @@ -15102,7 +15162,7 @@ "lodash.merge": "^4.6.2", "lodash.mergewith": "^4.6.2", "mime-types": "^2.1.33", - "qaseio": "^2.1.3", + "qaseio": "~2.2.0", "strip-ansi": "^6.0.1", "uuid": "^9.0.0" }, @@ -15167,9 +15227,32 @@ "jest": ">=28.0.0" } }, + "qase-jest/node_modules/qase-javascript-commons": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/qase-javascript-commons/-/qase-javascript-commons-2.0.13.tgz", + "integrity": "sha512-ER+q5kTrevo8jKzoHPDeFUOzdDt7ZLqL1ek6Py6oGlR5VnJRZegSt/BfJvXhbFcn2PLa5si/vaNSr/rnGhbF8Q==", + "license": "Apache-2.0", + "dependencies": { + "ajv": "^8.12.0", + "chalk": "^4.1.2", + "child-process-ext": "^3.0.2", + "env-schema": "^5.2.0", + "form-data": "^4.0.0", + "lodash.get": "^4.4.2", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "mime-types": "^2.1.33", + "qaseio": "~2.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "qase-mocha": { "name": "mocha-qase-reporter", - "version": "1.0.0", + "version": "1.0.0-beta.2", "license": "Apache-2.0", "dependencies": { "deasync-promise": "^1.0.1", @@ -15189,9 +15272,6 @@ }, "engines": { "node": ">=14" - }, - "peerDependencies": { - "cypress": ">=8.0.0" } }, "qase-mocha/node_modules/@types/node": { @@ -15204,6 +15284,29 @@ "undici-types": "~5.26.4" } }, + "qase-mocha/node_modules/qase-javascript-commons": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/qase-javascript-commons/-/qase-javascript-commons-2.0.13.tgz", + "integrity": "sha512-ER+q5kTrevo8jKzoHPDeFUOzdDt7ZLqL1ek6Py6oGlR5VnJRZegSt/BfJvXhbFcn2PLa5si/vaNSr/rnGhbF8Q==", + "license": "Apache-2.0", + "dependencies": { + "ajv": "^8.12.0", + "chalk": "^4.1.2", + "child-process-ext": "^3.0.2", + "env-schema": "^5.2.0", + "form-data": "^4.0.0", + "lodash.get": "^4.4.2", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "mime-types": "^2.1.33", + "qaseio": "~2.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "qase-newman": { "name": "newman-reporter-qase", "version": "2.0.0", @@ -15228,6 +15331,29 @@ "newman": ">=5.3.0" } }, + "qase-newman/node_modules/qase-javascript-commons": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/qase-javascript-commons/-/qase-javascript-commons-2.0.13.tgz", + "integrity": "sha512-ER+q5kTrevo8jKzoHPDeFUOzdDt7ZLqL1ek6Py6oGlR5VnJRZegSt/BfJvXhbFcn2PLa5si/vaNSr/rnGhbF8Q==", + "license": "Apache-2.0", + "dependencies": { + "ajv": "^8.12.0", + "chalk": "^4.1.2", + "child-process-ext": "^3.0.2", + "env-schema": "^5.2.0", + "form-data": "^4.0.0", + "lodash.get": "^4.4.2", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "mime-types": "^2.1.33", + "qaseio": "~2.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "qase-playwright": { "name": "playwright-qase-reporter", "version": "2.0.6", @@ -15250,6 +15376,29 @@ "@playwright/test": ">=1.16.3" } }, + "qase-playwright/node_modules/qase-javascript-commons": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/qase-javascript-commons/-/qase-javascript-commons-2.0.13.tgz", + "integrity": "sha512-ER+q5kTrevo8jKzoHPDeFUOzdDt7ZLqL1ek6Py6oGlR5VnJRZegSt/BfJvXhbFcn2PLa5si/vaNSr/rnGhbF8Q==", + "license": "Apache-2.0", + "dependencies": { + "ajv": "^8.12.0", + "chalk": "^4.1.2", + "child-process-ext": "^3.0.2", + "env-schema": "^5.2.0", + "form-data": "^4.0.0", + "lodash.get": "^4.4.2", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "mime-types": "^2.1.33", + "qaseio": "~2.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "qase-testcafe": { "name": "testcafe-reporter-qase", "version": "2.0.0", @@ -15271,8 +15420,31 @@ "testcafe": ">=2.0.0" } }, + "qase-testcafe/node_modules/qase-javascript-commons": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/qase-javascript-commons/-/qase-javascript-commons-2.0.13.tgz", + "integrity": "sha512-ER+q5kTrevo8jKzoHPDeFUOzdDt7ZLqL1ek6Py6oGlR5VnJRZegSt/BfJvXhbFcn2PLa5si/vaNSr/rnGhbF8Q==", + "license": "Apache-2.0", + "dependencies": { + "ajv": "^8.12.0", + "chalk": "^4.1.2", + "child-process-ext": "^3.0.2", + "env-schema": "^5.2.0", + "form-data": "^4.0.0", + "lodash.get": "^4.4.2", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "mime-types": "^2.1.33", + "qaseio": "~2.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^9.0.0" + }, + "engines": { + "node": ">=14" + } + }, "qaseio": { - "version": "2.1.5", + "version": "2.2.0", "license": "Apache-2.0", "dependencies": { "axios": "^0.28.0", diff --git a/qase-mocha/src/reporter.ts b/qase-mocha/src/reporter.ts index 9b5125c7..33673ef7 100644 --- a/qase-mocha/src/reporter.ts +++ b/qase-mocha/src/reporter.ts @@ -14,6 +14,7 @@ import { } from 'qase-javascript-commons'; import deasyncPromise from 'deasync-promise'; import { extname, join } from 'node:path'; +import { v4 as uuidv4 } from 'uuid'; const Events = Runner.constants; @@ -70,6 +71,7 @@ export class MochaQaseReporter extends reporters.Base { }); if (options.parallel) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment options.require = [...(options.require ?? []), resolveParallelModeSetupFile()]; } else { this.applyListeners(); @@ -153,7 +155,7 @@ export class MochaQaseReporter extends reporters.Base { run_id: null, signature: this.getSignature(test, ids), steps: this.currentTest.steps, - id: test.id, + id: uuidv4(), execution: { status: test.state ? MochaQaseReporter.statusMap[test.state]