@reportportal/agent-js-mocha
Advanced tools
Comparing version 5.0.1 to 5.0.2
## [5.0.2] - 2022-12-12 | ||
### Fixed | ||
- `skippedIssue` config property processing using .mocharc or string values | ||
- Skipped test duplication | ||
- Config attributes parsing using .mocharc | ||
### Security | ||
- Versions of several vulnerable dependencies updated | ||
### Added | ||
- `mode` option for submitting results to Debug tab | ||
- Latest error log to the step description | ||
### Changed | ||
- Package size reduced | ||
## [5.0.1] - 2020-06-23 | ||
### Added | ||
- Added link to the example in readme. | ||
- Added link to the example in readme. | ||
@@ -6,0 +22,0 @@ ## [5.0.0] - 2020-06-22 |
@@ -24,3 +24,3 @@ /* | ||
const testStatuses = require('./constants/testStatuses'); | ||
const { getCodeRef, getAgentInfo } = require('./utils'); | ||
const { getCodeRef, getAgentInfo, parseAttributes } = require('./utils'); | ||
@@ -155,3 +155,4 @@ const { | ||
]; | ||
if (this.options.reporterOptions.skippedIssue === false) { | ||
if (String(this.options.reporterOptions.skippedIssue).toLowerCase() === 'false') { | ||
this.options.reporterOptions.skippedIssue = false; | ||
const skippedIssueAttribute = { | ||
@@ -169,5 +170,4 @@ key: 'skippedIssue', | ||
const systemAttributes = this.getSystemAttributes(); | ||
const launchAttributes = (this.options.reporterOptions.attributes || []).concat( | ||
systemAttributes, | ||
); | ||
const attributes = parseAttributes(this.options.reporterOptions.attributes); | ||
const launchAttributes = (attributes || []).concat(systemAttributes); | ||
const { tempId, promise } = this.rpClient.startLaunch({ | ||
@@ -178,2 +178,3 @@ token: this.options.reporterOptions.token, | ||
description: this.options.reporterOptions.description, | ||
mode: this.options.reporterOptions.mode, | ||
rerun: this.options.reporterOptions.rerun, | ||
@@ -278,3 +279,8 @@ rerunOf: this.options.reporterOptions.rerunOf, | ||
const testAttributes = this.attributes.get(this.currentTest.tempId); | ||
const testDescription = this.descriptions.get(this.currentTest.tempId); | ||
let testDescription = this.descriptions.get(this.currentTest.tempId); | ||
if (test.err) { | ||
testDescription = (testDescription || '').concat( | ||
`\n\`\`\`error\n${test.err.stack}\n\`\`\``, | ||
); | ||
} | ||
const testCaseId = this.testCaseIds.get(this.currentTest.tempId); | ||
@@ -360,3 +366,5 @@ const testStatus = this.testItemStatuses.get(this.currentTest.tempId) || autoStatus; | ||
onTestPending(test) { | ||
this.onTestStart(test); | ||
if (this.currentTest === null) { | ||
this.onTestStart(test); | ||
} | ||
this.finishTest(test, testStatuses.SKIPPED); | ||
@@ -363,0 +371,0 @@ } |
@@ -33,2 +33,14 @@ /* | ||
module.exports = { getCodeRef, getAgentInfo }; | ||
const parseAttributes = (attributes) => { | ||
if (typeof attributes === 'string') { | ||
return attributes.split(';').map((attributeStr) => { | ||
const attribute = attributeStr.split(':'); | ||
return attribute.length === 2 | ||
? { key: attribute[0], value: attribute[1] } | ||
: { value: attribute[0] }; | ||
}); | ||
} | ||
return attributes; | ||
}; | ||
module.exports = { getCodeRef, getAgentInfo, parseAttributes }; |
{ | ||
"name": "@reportportal/agent-js-mocha", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Mocha reporter for the Report Portal", | ||
@@ -22,6 +22,12 @@ "main": "index.js", | ||
], | ||
"directories": { | ||
"lib": "./lib" | ||
}, | ||
"files": [ | ||
"/lib" | ||
], | ||
"license": "Apache 2.0", | ||
"dependencies": { | ||
"@reportportal/client-javascript": "^5.0.0", | ||
"mocha": "^7.0.1" | ||
"@reportportal/client-javascript": "^5.0.6", | ||
"mocha": "^10.2.0" | ||
}, | ||
@@ -43,3 +49,3 @@ "repository": { | ||
"eslint-plugin-promise": "^4.2.1", | ||
"jest": "^25.3.0", | ||
"jest": "^28.1.3", | ||
"prettier": "^1.19.1" | ||
@@ -46,0 +52,0 @@ }, |
@@ -13,3 +13,3 @@ # Mocha reporter for EPAM report portal | ||
## How to use: | ||
Fill reporterOptions in Mocha configuration. | ||
Fill reporterOptions in Mocha configuration. | ||
```javascript | ||
@@ -20,3 +20,3 @@ const Mocha = require("mocha"); | ||
reporterOptions: { | ||
"token": "00000000-0000-0000-0000-000000000000", | ||
"token": "00000000-0000-0000-0000-000000000000", | ||
"endpoint": "https://your.reportportal.server/api/v1", | ||
@@ -37,3 +37,22 @@ "project": "YourReportPortalProjectName", | ||
``` | ||
Using `.mocharc.js`: | ||
```javascript | ||
module.exports = { | ||
'extension': ['js', 'cjs', 'mjs'], | ||
'package': './package.json', | ||
reporter: '@reportportal/agent-js-mocha', | ||
'reporter-option':[ | ||
'endpoint=https://your.reportportal.server/api/v1', | ||
'token=00000000-0000-0000-0000-000000000000', | ||
'launch=YourLauncherName', | ||
'project=YourReportPortalProjectName', | ||
'attributes=YourKey:YourValue;YourValue', | ||
], | ||
'file': [ | ||
'spec/someTest.spec.js', | ||
] | ||
} | ||
``` | ||
#### You can find an example of using Mocha Reporter [here](https://github.com/reportportal/examples-js/tree/master/example-mocha). | ||
@@ -50,3 +69,4 @@ | ||
| launch | Name of launch at creation. | | ||
| project | The name of the project in which the launches will be created. | | ||
| project | The name of the project in which the launches will be created. | ||
| mode | *Default: "default".* Results will be submitting to Launches tab<br> *"debug"* - Results will be submitting to Debug tab. | | ||
| rerun | *Default: false.* Enable [rerun](https://github.com/reportportal/documentation/blob/master/src/md/src/DevGuides/rerun.md)| | ||
@@ -119,3 +139,3 @@ | rerunOf | UUID of launch you want to rerun. If not specified, report portal will update the latest launch with the same name| | ||
**addAttributes (*attributes*)**. Add attributes(tags) to the current test/suite. Should be called inside of corresponding test or suite.</br> | ||
**addAttributes (*attributes*)**. Add attributes(tags) to the current test/suite. Should be called inside of corresponding test or suite.</br> | ||
*attributes* is array of pairs of key and value: | ||
@@ -149,3 +169,3 @@ ```javascript | ||
To integrate with Sauce Labs just add attributes: | ||
To integrate with Sauce Labs just add attributes: | ||
@@ -164,5 +184,5 @@ ```javascript | ||
**setDescription (*description*)**. Set text description to the current test/suite. Should be called inside of corresponding test or suite.</br> | ||
**setDescription (*description*)**. Set text description to the current test/suite. Should be called inside of corresponding test or suite.</br> | ||
Mocha doesn't allow functional calls directly into describe section. You can call setDescription inside of before/after hooks to set description to the corresponding suite. | ||
Mocha doesn't allow functional calls directly into describe section. You can call setDescription inside of before/after hooks to set description to the corresponding suite. | ||
@@ -185,5 +205,5 @@ **Example:** | ||
**setTestCaseId (*testCaseId*)**. Set test case id to the current test/suite. Should be called inside of corresponding test or suite.</br> | ||
**setTestCaseId (*testCaseId*)**. Set test case id to the current test/suite. Should be called inside of corresponding test or suite.</br> | ||
Mocha doesn't allow functional calls directly into describe section. You can call setTestCaseId inside of before/after hooks to set test case id to the corresponding suite. | ||
Mocha doesn't allow functional calls directly into describe section. You can call setTestCaseId inside of before/after hooks to set test case id to the corresponding suite. | ||
@@ -244,5 +264,5 @@ **Example:** | ||
``` | ||
# Copyright Notice | ||
Licensed under the [Apache License v2.0](LICENSE) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
260
47351
11
534
1
+ Addedansi-colors@4.1.3(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedcamelcase@6.3.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcliui@7.0.4(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addeddecamelize@4.0.0(transitive)
+ Addeddiff@5.2.0(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedflat@5.0.2(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-plain-obj@2.1.0(transitive)
+ Addedis-unicode-supported@0.1.0(transitive)
+ Addedjs-yaml@4.1.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlog-symbols@4.1.0(transitive)
+ Addedmocha@10.8.2(transitive)
+ Addedms@2.1.3(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedserialize-javascript@6.0.2(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedsupports-color@7.2.08.1.1(transitive)
+ Addedworkerpool@6.5.1(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@16.2.0(transitive)
+ Addedyargs-parser@20.2.9(transitive)
+ Addedyargs-unparser@2.0.0(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removedansi-colors@3.2.3(transitive)
- Removedansi-regex@3.0.14.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedarray.prototype.reduce@1.0.7(transitive)
- Removedarraybuffer.prototype.slice@1.0.3(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcall-bind@1.0.8(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.2(transitive)
- Removedcamelcase@5.3.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedchokidar@3.3.0(transitive)
- Removedcliui@5.0.0(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddata-view-buffer@1.0.1(transitive)
- Removeddata-view-byte-length@1.0.1(transitive)
- Removeddata-view-byte-offset@1.0.0(transitive)
- Removeddebug@3.2.6(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddiff@3.5.0(transitive)
- Removeddunder-proto@1.0.0(transitive)
- Removedemoji-regex@7.0.3(transitive)
- Removedes-abstract@1.23.5(transitive)
- Removedes-array-method-boxes-properly@1.0.0(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-to-primitive@1.3.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedesprima@4.0.1(transitive)
- Removedfind-up@3.0.0(transitive)
- Removedflat@4.1.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfsevents@2.1.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.6(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.6(transitive)
- Removedget-symbol-description@1.0.2(transitive)
- Removedglob@7.1.3(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.2.0(transitive)
- Removedgrowl@1.10.5(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.1.0(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-async-function@2.0.0(transitive)
- Removedis-bigint@1.1.0(transitive)
- Removedis-boolean-object@1.2.1(transitive)
- Removedis-buffer@2.0.5(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.2(transitive)
- Removedis-date-object@1.1.0(transitive)
- Removedis-finalizationregistry@1.1.0(transitive)
- Removedis-fullwidth-code-point@2.0.0(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-negative-zero@2.0.3(transitive)
- Removedis-number-object@1.1.0(transitive)
- Removedis-regex@1.2.1(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.1.0(transitive)
- Removedis-symbol@1.1.1(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakref@1.1.0(transitive)
- Removedis-weakset@2.0.3(transitive)
- Removedisarray@2.0.5(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjs-yaml@3.13.1(transitive)
- Removedlocate-path@3.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlog-symbols@3.0.0(transitive)
- Removedmath-intrinsics@1.0.0(transitive)
- Removedminimatch@3.0.4(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.5(transitive)
- Removedmocha@7.2.0(transitive)
- Removedms@2.1.1(transitive)
- Removednode-environment-flags@1.0.6(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.04.1.5(transitive)
- Removedobject.getownpropertydescriptors@2.1.8(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@3.0.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedreaddirp@3.2.0(transitive)
- Removedreflect.getprototypeof@1.0.8(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedrequire-main-filename@2.0.0(transitive)
- Removedsafe-array-concat@1.1.3(transitive)
- Removedsafe-regex-test@1.1.0(transitive)
- Removedsemver@5.7.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstring-width@2.1.13.1.0(transitive)
- Removedstring.prototype.trim@1.2.10(transitive)
- Removedstring.prototype.trimend@1.0.9(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedstrip-ansi@4.0.05.2.0(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedsupports-color@5.5.06.0.0(transitive)
- Removedtyped-array-buffer@1.0.2(transitive)
- Removedtyped-array-byte-length@1.0.1(transitive)
- Removedtyped-array-byte-offset@1.0.3(transitive)
- Removedtyped-array-length@1.0.7(transitive)
- Removedunbox-primitive@1.0.2(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwhich-boxed-primitive@1.1.0(transitive)
- Removedwhich-builtin-type@1.2.1(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwhich-typed-array@1.1.16(transitive)
- Removedwide-align@1.1.3(transitive)
- Removedwrap-ansi@5.1.0(transitive)
- Removedy18n@4.0.3(transitive)
- Removedyargs@13.3.2(transitive)
- Removedyargs-parser@13.1.2(transitive)
- Removedyargs-unparser@1.6.0(transitive)
Updatedmocha@^10.2.0