Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reportportal/agent-js-mocha

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reportportal/agent-js-mocha - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

18

CHANGELOG.md
## [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

22

lib/mochaReporter.js

@@ -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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc