@ai-testing-tool/forge-jest
v2.2.1
Published
AI Testing Tool Jest reporter — ingest or file modes via @ai-testing-tool/forge-commons
Maintainers
Readme
@ai-testing-tool/forge-jest
Jest reporter for AI Testing Tool (Jira Forge quality hub).
Install
npm install -D @ai-testing-tool/forge-jest @ai-testing-tool/forge-commonsConfigure
// jest.config.js
module.exports = {
testEnvironment: 'node',
reporters: [
'default',
[
'@ai-testing-tool/forge-jest',
{
// Defaults to mode=off (no credentials required)
// mode: 'ingest' | 'file' | 'off',
// projectKey: 'DEMO',
},
],
],
};Modes
| Mode | Behavior |
| ---- | -------- |
| off (default) | No network / file write |
| file | Writes ingest payload (default ./ai-testing-tool-results.json) |
| ingest | POSTs the payload with format: jest-json |
Env (same as CLI): AI_TESTING_TOOL_MODE, AI_TESTING_TOOL_PROJECT_KEY, AI_TESTING_TOOL_INGEST_URL, AI_TESTING_TOOL_INGEST_TOKEN, AI_TESTING_TOOL_LAUNCH_NAME.
Helpers
const { qa } = require('@ai-testing-tool/forge-jest/jest');
test('AUTH-101 login', async () => {
await qa.suite('Auth');
await qa.suiteId('suite-uuid');
await qa.planId('plan-uuid');
await qa.plan('Smoke');
await qa.fixVersion('2.4.0');
await qa.sprintName('Sprint 42');
await qa.labels('test-auto,flaky');
await qa.step('open form', async () => {
expect(true).toBe(true);
});
});Prefer Jira issue keys in test titles.
With the @ai-testing-tool/forge-jest reporter loaded (use --runInBand so helpers share the reporter bridge), qa.* metadata is attached as assertionResults[].meta.qa on Path B ingest/file. The bridge is stored on Node process so it also works under jsdom (UI *.test.tsx) environments. Forge reads plan / fix version / sprint from meta.qa only (not top-level ingest payload fields).
Dual path
Path A — native JSON + CLI (upload path; raw Jest JSON file):
npx jest --json --outputFile=ai-testing-tool-results.json
npx @ai-testing-tool/forge-api-client --project DEMO --report ai-testing-tool-results.jsonPath B — @ai-testing-tool/forge-jest reporter (mode=ingest or mode=file):
AI_TESTING_TOOL_MODE=ingest \
AI_TESTING_TOOL_PROJECT_KEY=DEMO \
AI_TESTING_TOOL_INGEST_URL=... \
AI_TESTING_TOOL_INGEST_TOKEN=... \
npx jestmode=file writes an ingest payload (not raw Jest JSON). Path A and Path B produce schema-equivalent ingest payloads for the same run (format: jest-json, same assertion titles/statuses).
