
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