New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-qase-reporter

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-qase-reporter

Qase TMS Jest Reporter

1.0.0
Source
npm
Version published
Weekly downloads
1.1K
30.2%
Maintainers
1
Weekly downloads
 
Created
Source

Qase TMS Jest Reporter

License

Installation

npm install jest-qase-reporter

Configuration

Reporter options (* - required):

  • *apiToken - Token for API access, you can find more information here
  • *projectCode - Code of your project (can be extracted from main page of your project: https://app.qase.io/project/DEMOTR - DEMOTR is project code here)
  • runId - Run ID from Qase TMS (also can be got from run URL)
  • logging [true/false] - Enabled debug logging from reporter or not

Example jest.config.js config:

module.exports = {
  reporters: [
    'default',
    [
      'jest-qase-reporter',
      {
        apiToken: '578e3b73a34f06e84eafea103cd44dc24253b2c5',
        projectCode: 'PRJCODE',
        runId: 45,
        logging: true,
      },
    ],
  ],
  ...
};

You can check example configuration with multiple reporters in example project

Supported ENV variables:

  • QASE_REPORT - You should pass this ENV if you want to use qase reporter
  • QASE_API_TOKEN - API token
  • QASE_RUN_ID - Pass Run ID from ENV and override reporter options
  • QASE_RUN_NAME - Set custom Run name, when new run is created
  • QASE_RUN_DESCRIPTION - Set custom Run description, when new run is created

Using Reporter

If you want to decorate come test with Qase Case ID you could use qase function:

import { qase } from 'jest-qase-reporter/dist/jest';

describe('My First Test', () => {
    
    test(qase([1,2], 'Several ids'), () => {
        expect(true).to.equal(true);
    })

    test(qase(3, 'Correct test'), () => {
        expect(true).to.equal(true);
    })

    test.skip(qase("4", 'Skipped test'), () => {
        expect(true).to.equal(true);
    })

    test(qase(["5", "6"], 'Failed test'), () => {
        expect(true).to.equal(false);
    })
});

Running Jest Reporter

To start jest run with qase reporter run it like this:

QASE_REPORT=1 npx jest

FAQs

Package last updated on 14 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts