# jest-reporter-testrail

> Reporter plugin that sends test coverage and test results to TestRail

Latest version **0.1.3** (published 2020-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-reporter-testrail
pnpm add jest-reporter-testrail
yarn add jest-reporter-testrail
bun add jest-reporter-testrail
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2020-07-07 |
| First published | 2020-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.8 |
| Dependencies | 2 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Damian Osipiuk |
| Maintainers | mrmentor |
| Keywords | jest, reporter, plugin, testrail |

## Links

- npm: https://www.npmjs.com/package/jest-reporter-testrail
- Repository: https://github.com/DamianOsipiuk/jest-reporter-testrail
- Homepage: https://github.com/DamianOsipiuk/jest-reporter-testrail#readme
- Issues: https://github.com/DamianOsipiuk/jest-reporter-testrail/issues
- npm.io page: https://npm.io/package/jest-reporter-testrail

## Dependencies (2)

- [moment](https://npm.io/package/moment.md) ^2.27.0
- [testrail-js-api](https://npm.io/package/testrail-js-api.md) ^0.1.6

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2020-07-07
- 0.1.2 — 2020-04-10
- 0.1.1 — 2020-03-05
- 0.1.0 — 2020-03-05

## README

[![NPM](https://img.shields.io/npm/v/jest-reporter-testrail)](https://www.npmjs.com/package/jest-reporter-testrail) [![NPM](https://img.shields.io/npm/l/jest-reporter-testrail)](https://github.com/DamianOsipiuk/jest-reporter-testrail/blob/master/LICENSE) [![NPM](https://img.shields.io/node/v/jest-reporter-testrail)](https://github.com/DamianOsipiuk/jest-reporter-testrail/blob/master/package.json)

# Description

Reporter plugin that sends test coverage and test results to TestRail

**It does not provide std output, please use with combination with the default reporter**

# Usage

1. Installation

   `npm install jest-reporter-testrail --save-dev`

2. Add reporter to jest configuration. Make sure to also include **default** reporter if **reporters** option was not provided

```
reporters: [
  'default',
  'jest-reporter-testrail'
],
```

3. Provide required options from the configuration section

# Configuration

Configuration can be provided via:

- ENV variables
- configuration file (.testrailrc)
- reporter options in jest config

  `reporters: [ 'default', ['jest-reporter-testrail', {option1: '', option2: ''}] ],`

Both configuration file and reporter options use the same schema.

| ENV Variable              | Config         | Description                                                                                                                                                                                                                                                                                                            |           Default           | Required |
| ------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------: | :------: |
| TESTRAIL_ENABLE           | enabled        | Enables TestRail integration.                                                                                                                                                                                                                                                                                          |           `false`           |          |
| TESTRAIL_HOST             | host           | URL of the TestRail instance.                                                                                                                                                                                                                                                                                          |                             |  `true`  |
| TESTRAIL_USER             | user           | Account name which will be used to push results.                                                                                                                                                                                                                                                                       |                             |  `true`  |
| TESTRAIL_API_KEY          | apiKey         | API key which can be generated on the profile page in TestRail.                                                                                                                                                                                                                                                        |                             |  `true`  |
| TESTRAIL_PROJECT_ID       | projectId      | Project id in which test cases are stored. Ex. `P123`                                                                                                                                                                                                                                                                  |                             |  `true`  |
| TESTRAIL_SUITE_ID         | suiteId        | Suite id in which test cases are stored. Ex. `S123`                                                                                                                                                                                                                                                                    |                             |  `true`  |
| TESTRAIL_COVERAGE_CASE_ID | coverageCaseId | Test Case ID which will be used to post test results. It will appear in Test Run as executed with coverage and results as description.                                                                                                                                                                                 |                             |  `true`  |
| TESTRAIL_RUN_NAME         | runName        | Test Run name. Configurable with variables <ul><li>`%BRANCH%` - see config option `branchEnv`</li><li>`%BUILD%` - see config option `buildNoEnv`</li><li>`%DATE%` - see config option `dateFormat`</li></ul>                                                                                                           | `%BRANCH%#%BUILD% - %DATE%` |          |
| TESTRAIL_RUN_DESCRIPTION  | runDescription | You can provide you own Test Run description. If this option is not configured, it will contain test results and test coverage.                                                                                                                                                                                        |                             |          |
| TESTRAIL_REFERENCE        | reference      | String that will be added to the `refs` field in TestRail. This can enable integration with other tools like https://github.com/DamianOsipiuk/testcafe-reporter-testrail/. Configurable with variables <ul><li>`%BRANCH%` - see config option `branchEnv`</li><li>`%BUILD%` - see config option `buildNoEnv`</li></ul> |                             |          |
| TESTRAIL_BRANCH_ENV       | branchEnv      | Which ENV variable is used to store branch name on which tests are run.                                                                                                                                                                                                                                                |          `BRANCH`           |          |
| TESTRAIL_BUILD_NO_ENV     | buildNoEnv     | Which ENV variable is used to store build number of tests run.                                                                                                                                                                                                                                                         |       `BUILD_NUMBER`        |          |
| TESTRAIL_DATE_FORMAT      | dateFormat     | What date format should be used for `%DATE%` placeholder. https://momentjs.com/ formats supported.                                                                                                                                                                                                                     |    `YYYY-MM-DD HH:mm:ss`    |          |

---
_Source: https://npm.io/package/jest-reporter-testrail · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
