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
0
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.4 to 5.1.0

25

package.json
{
"name": "@reportportal/agent-js-mocha",
"version": "5.0.4",
"description": "Mocha reporter for the Report Portal",
"version": "5.1.0",
"description": "Agent to integrate Mocha with ReportPortal.",
"author": "ReportPortal.io",

@@ -13,4 +13,4 @@ "scripts": {

"dependencies": {
"@reportportal/client-javascript": "~5.0.15",
"mocha": "^10.2.0"
"@reportportal/client-javascript": "~5.1.4",
"mocha": "^10.7.0"
},

@@ -25,17 +25,16 @@ "directories": {

"engines": {
"node": ">=10.x"
"node": ">=12.x"
},
"license": "Apache 2.0",
"devDependencies": {
"@types/jest": "^29.5.3",
"eslint": "^8.45.0",
"@types/jest": "^29.5.12",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^23.8.0",
"eslint-plugin-mocha": "^6.2.2",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^4.2.1",
"jest": "^29.6.1",
"eslint-plugin-promise": "^4.3.1",
"jest": "^29.7.0",
"prettier": "^2.8.8"

@@ -42,0 +41,0 @@ },

@@ -15,4 +15,5 @@ # @reportportal/agent-js-mocha

## How to use:
Fill reporterOptions in Mocha configuration.
## Configuration
Fill in the `reporterOptions` in Mocha configuration.
```javascript

@@ -39,2 +40,3 @@ const Mocha = require("mocha");

```
Using `.mocharc.js`:

@@ -60,4 +62,2 @@ ```javascript

#### You can find an example of using Mocha Reporter [here](https://github.com/reportportal/examples-js/tree/master/example-mocha).
### Options

@@ -67,23 +67,31 @@

| Option | Necessity | Default | Description |
|------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| apiKey | Required | | User's reportportal token from which you want to send requests. It can be found on the profile page of this user. |
| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v1'. |
| launch | Required | | Name of launch at creation. |
| project | Required | | The name of the project in which the launches will be created. |
| attributes | Optional | [] | Launch attributes. |
| description | Optional | '' | Launch description. |
| rerun | Optional | false | Enable [rerun](https://reportportal.io/docs/dev-guides/RerunDevelopersGuide) |
| rerunOf | Optional | Not set | UUID of launch you want to rerun. If not specified, reportportal will update the latest launch with the same name |
| mode | Optional | 'DEFAULT' | Results will be submitted to Launches page <br/> *'DEBUG'* - Results will be submitted to Debug page (values must be upper case). |
| skippedIssue | Optional | true | reportportal provides feature to mark skipped tests as not 'To Investigate'. <br/> Option could be equal boolean values: <br/> *true* - skipped tests considered as issues and will be marked as 'To Investigate' on reportportal. <br/> *false* - skipped tests will not be marked as 'To Investigate' on application. |
| debug | Optional | false | This flag allows seeing the logs of the client-javascript. Useful for debugging. |
| reportHooks | Optional | false | Determines report before and after hooks or not. |
| restClientConfig | Optional | Not set | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests). <br/> Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. |
| token | Deprecated | Not set | Use `apiKey` instead. |
| Option | Necessity | Default | Description |
|-----------------------|------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| apiKey | Required | | User's reportportal token from which you want to send requests. It can be found on the profile page of this user. |
| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v1'. |
| launch | Required | | Name of launch at creation. |
| project | Required | | The name of the project in which the launches will be created. |
| attributes | Optional | [] | Launch attributes. |
| description | Optional | '' | Launch description. |
| rerun | Optional | false | Enable [rerun](https://reportportal.io/docs/dev-guides/RerunDevelopersGuide) |
| rerunOf | Optional | Not set | UUID of launch you want to rerun. If not specified, reportportal will update the latest launch with the same name |
| mode | Optional | 'DEFAULT' | Results will be submitted to Launches page <br/> *'DEBUG'* - Results will be submitted to Debug page (values must be upper case). |
| debug | Optional | false | This flag allows seeing the logs of the client-javascript. Useful for debugging. |
| restClientConfig | Optional | Not set | `axios` like http client [config](https://github.com/axios/axios#request-config). May contain `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, and other client options e.g. `proxy`, [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests). For debugging and displaying logs the `debug: true` option can be used. <br/> Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. |
| headers | Optional | {} | The object with custom headers for internal http client. |
| launchUuidPrint | Optional | false | Whether to print the current launch UUID. |
| launchUuidPrintOutput | Optional | 'STDOUT' | Launch UUID printing output. Possible values: 'STDOUT', 'STDERR', 'FILE', 'ENVIRONMENT'. Works only if `launchUuidPrint` set to `true`. File format: `rp-launch-uuid-${launch_uuid}.tmp`. Env variable: `RP_LAUNCH_UUID`, note that the env variable is only available in the reporter process (it cannot be obtained from tests). |
| skippedIssue | Optional | true | reportportal provides feature to mark skipped tests as not 'To Investigate'. <br/> Option could be equal boolean values: <br/> *true* - skipped tests considered as issues and will be marked as 'To Investigate' on reportportal. <br/> *false* - skipped tests will not be marked as 'To Investigate' on application. |
| reportHooks | Optional | false | Determines report before and after hooks or not. |
| token | Deprecated | Not set | Use `apiKey` instead. |
### Additional reporting functionality
The agent provides an API to extend the functionality of Mocha.
## Examples
The `agent-js-mocha` usage example can be found [here](https://github.com/reportportal/examples-js/tree/master/example-mocha).
## Reporting
This reporter provides Reporting API to use it directly in tests to send some additional data to the report.
Import the `PublicReportingAPI` as shown below to use additional reporting features.

@@ -94,3 +102,3 @@

```
#### Report logs and attachments
### Logs and attachments
`PublicReportingAPI` provides the following methods for reporting logs into the current test/step.

@@ -146,3 +154,3 @@

```
#### Report attributes for steps and suites
### Attributes for steps and suites

@@ -190,3 +198,3 @@ **addAttributes (*attributes*)**. Add attributes(tags) to the current test/suite. Should be called inside of corresponding test or suite.</br>

#### Report description for steps and suites
### Description for steps and suites

@@ -211,3 +219,3 @@ **setDescription (*description*)**. Set text description to the current test/suite. Should be called inside of corresponding test or suite.</br>

#### Report test case id for steps and suites
### Test case id for steps and suites

@@ -224,6 +232,6 @@ **setTestCaseId (*testCaseId*)**. Set test case id to the current test/suite. Should be called inside of corresponding test or suite.</br>

before(function (){
PublicReportingAPI.setTestCaseId('TestCaseIdForTheSuite'));
PublicReportingAPI.setTestCaseId('TestCaseIdForTheSuite');
});
it('test', () => {
PublicReportingAPI.setTestCaseId('TestCaseIdForTheTest'));
PublicReportingAPI.setTestCaseId('TestCaseIdForTheTest');
});

@@ -233,3 +241,3 @@ });

#### Finish launch/test item with status
### Finish launch/test item with explicit status

@@ -269,3 +277,3 @@ PublicReportingAPI provides the following methods for setting status to the current suite/spec.

it('test info', function() {
PublicReportingAPI.setStatusInfo();
PublicReportingAPI.setStatusFailed();
expect(true).to.be.equal(true);

@@ -272,0 +280,0 @@ });

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