src/, integration-tests/, packages/contracts-workspace, or packages/contracts-workspace-mcp.Focus first on mutating flows, parser/validator boundaries, and policy/safety checks.
Prioritize branches where failures could produce wrong legal output or unsafe automation behavior.
Use normal unit/integration tests with Allure labels, steps, and attachments in the same files.
If behavior is important enough to test, map it to canonical OpenSpec scenarios or active change-package scenarios.
Verify user-observable outputs, diagnostics, and mutation outcomes before internals.
Attach structured context for inputs, normalized outputs, and error payloads.
Execute test body.integration-tests/helpers/allure-test.tsitAllure, testAllure, allureStep, allureJsonAttachment, allurePrettyJsonAttachment, allureWordLikeTextAttachment, allureParameter, allureSeverityallure-vitest in tests.src//.test.ts and integration-tests//.test.ts.scripts/patch_allure_html_sanitizer.mjs, invoked by npm run report:allure). Do not bypass this pipeline when generating reports for review.src/.test.ts ..allure.test.ts files to .test.ts; do not introduce new *.allure.test.ts files..openspec('OA-###') whenever a matching scenario ID exists for the behavior.openspec/specs/open-agreements/spec.md) or active change-package specs (openspec/changes//specs/open-agreements/spec.md ).src/core/** and integration flows.critical: mutation correctness, legal-output integrity, data-loss risk, security/policy guardrails.normal: standard behavior and compatibility scenarios.minor: narrow edge cases with low production impact.npm run test:run
npm run test:coverage
npm run check:spec-coverage
npm run check:allure-labels
import { describe, expect } from 'vitest';
import { itAllure as it, allureStep, allureJsonAttachment } from '../../../integration-tests/helpers/allure-test.js';
describe('checklist patch behavior', () => {
it('applies replacement deterministically', async () => {
let result: { ok: boolean };
await allureStep('Given a valid patch payload', async () => {
await allureJsonAttachment('patch-input.json', {
patch_id: 'patch_001',
operations: [{ op: 'replace', path: '/issues/0/status', value: 'CLOSED' }],
});
});
await allureStep('When patch validation runs', async () => {
result = { ok: true };
});
await allureStep('Then validation succeeds', async () => {
expect(result!.ok).toBe(true);
});
});
});
references/allure-test-spec-writing-guide.md for full Allure step-writing guidance.共 1 个版本