mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-29 23:37:41 +00:00
* fix: recover missed test scenarios Run the full core test inventory and retrieve identical callback bodies across setup contexts. Separate assertion evidence from context and retain conservative input, path and runtime provenance checks. Restore prepared test inputs and report missing runtime collection. Add the audited recall corpus and inventory regressions. * Address PR review feedback (#3743) Correct counted nouns in the inventory report, document fully skipped modules, and include unhandled runner errors in the incomplete-collection warning. * Address PR review feedback (#3743) Force-stage explicit temporary fixtures despite inherited Git ignores, and isolate recorded-file collection-error accounting in the inventory tests. * fix(review): simplify selection and guard mixed artifacts * feat(test): detect fixture consolidation opportunities Capture source inputs used by integration tests and compare fixture clones, executed blocks, and assertion subjects and values. Report partial overlaps with the unique checks and fixture spans that consolidation must preserve. Keep cross-language structural suggestions separate from observed equality. Use pinned jscpd with direct pair verification when longer representatives hide partial clones. Retain capture gaps and native/worker limitations. Validate with 1,245 detector regressions, 28 pipeline pair controls, and 12 manually labeled comparisons. Scan 30,698 core cases and find 3,111 opportunity groups; exclude the capture's 103 failed and 89 skipped cases. * Fix scenario-map review findings (#3743) Resolve assertion aliases by lexical binding and normalize duplicate static object keys. Capture fixture files through checked descriptors with bounded reads and guaranteed cleanup. * fix: address test duplicate audit false signals * refactor(test): reuse assertion binding analysis Reuse lexical bindings within each evidence extraction while retaining assertion-specific offsets and expansion limits. Deduplicate fixture coverage endpoints numerically without string conversion. Preserve complete assertion evidence across 29,286 static instances and weighted coverage across 10,000 generated interval cases. * Fix scenario-map review findings (#3743) Bind consolidation evidence to the assertion call accepted by the check extractor, so unsupported same-line calls cannot supply incorrect subjects or expectations. Keep source provenance private and serialized checks intact. Exercise omitted plugins alongside instrumented Vitest runs. * fix: retain input-shaped scenario controls (#3743) Compare assertion subject structure separately from exact input-bearing assertion keys, so changing literal inputs retains table-row and boundary classification. Preserve selectors, callee identity and regex values. Keep the control expectations unchanged. Add regressions for literal inputs, queried subjects and nested regex arguments; bump the fingerprint engine version so reclassified findings resurface. * test: give scenario cases unique titles Include the parameterized case index so repeated input expressions and truncated audit paths cannot collide in the CI execution inventory. * fix: scope assertion subjects to their bindings Prevent same-named declarations in different files or scopes from becoming exact assertion matches. Preserve same-binding consolidation and advance the fingerprint engine to version 5. * fix: raise full-suite planning heap budget The 30,953-case replay aborts at the default 4 GiB heap. Give only the Plan step 8 GiB and document the same local invocation. The identical four coverage slices complete in 4m34s at 8.2 GiB peak RSS, retaining all 116,409 candidate pairs. * fix: stream full-suite scenario reports The full inventory produces a 663 MiB report, exceeding V8's single-string limit. Write records incrementally and stream only required fields when reading baselines and publishing issue updates. Replay preserves all 116,398 pairs from 30,953 collected cases. The report remains partial when the trace run fails. * fix: preserve test lifecycles during capture Forced test repeats changed cache and file state. Capture ordinary runs, retain runnable siblings during tracing, and keep retry-bearing files inconclusive. Preserve failure details and mark failed captures partial. Use the original JSON serializer so test mocks cannot break fixture reads. * fix: limit trace capture to candidates Keep sibling tests in both passes for suite state, while recording only candidate task IDs. This prevents unrelated timing checks and large corpus tests from failing under tracing. * ci: budget full-suite trace collection * fix: address scenario-map feedback (#3743) --------- Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
420 lines
17 KiB
TypeScript
420 lines
17 KiB
TypeScript
/**
|
|
* Locks the scenario map report (U13, R12, KTD13, KTD15, design §5.5, §7, §8): mutant fingerprints
|
|
* (span-free, operator, replacement, enclosing statement, fallbacks), KTD13 universe ids, evidence
|
|
* hashes (an engine-version bump changes every one, regrouping keeps them), the seeded spot audit,
|
|
* "N of M evaluated", completeness, the Layer 0 section, KTD15 provenance collection and the
|
|
* markdown rendering.
|
|
*/
|
|
import { createHash } from 'node:crypto';
|
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
import os from 'node:os';
|
|
import path from 'node:path';
|
|
import { afterAll, describe, expect, it } from 'vitest';
|
|
import { contentHash } from '../../../tools/mutation/prepare/mutant-identity.js';
|
|
import {
|
|
fingerprintMutants,
|
|
universeIdOf,
|
|
type FingerprintFallback,
|
|
} from '../../../tools/scenario-map/report/anchors.js';
|
|
import { mdCode, renderMarkdown } from '../../../tools/scenario-map/report/markdown.js';
|
|
import {
|
|
PRECISION_NOT_MEASURED,
|
|
REDACTED,
|
|
buildReport,
|
|
collectProvenance,
|
|
spotAudit,
|
|
type SpotAuditPick,
|
|
} from '../../../tools/scenario-map/report/report.js';
|
|
import { SCENARIO_MAP_SCHEMA_VERSION } from '../../../tools/scenario-map/types.js';
|
|
import { computeFingerprints } from '../../../tools/scenario-map/verdict/fingerprint.js';
|
|
import { VERDICT_ENGINE_VERSION } from '../../../tools/scenario-map/verdict/verdict.js';
|
|
import { A, B, C, FILE, M1, M2, M3, fingerprints, reportInput } from './report-fixtures.js';
|
|
|
|
const sha256 = (text: string): string => createHash('sha256').update(text).digest('hex');
|
|
const SRC = 'gitnexus/src/math.ts';
|
|
const idOf = (source: string, span: string, mutator: string, replacement: string): string =>
|
|
`${SRC}@${contentHash(source).slice(0, 16)}:${span}:${mutator}:${sha256(replacement).slice(0, 16)}`;
|
|
const fingerprintIn = (source: string, id: string): string =>
|
|
fingerprintMutants([id], () => source).get(id)?.fingerprint ?? '';
|
|
|
|
// ── Mutant fingerprints ────────────────────────────────────────────────────
|
|
|
|
const ADD = 'export function add(a: number, b: number): number {\n return a + b;\n}\n';
|
|
const ADD_ID = idOf(ADD, '2:10-2:15', 'ArithmeticOperator', 'a - b');
|
|
|
|
describe('mutant fingerprint', () => {
|
|
it('survives lines inserted above the mutant (no revision, no span)', () => {
|
|
const shifted = `// header\n\n${ADD}`;
|
|
const moved = idOf(shifted, '4:10-4:15', 'ArithmeticOperator', 'a - b');
|
|
expect(fingerprintIn(shifted, moved)).toBe(fingerprintIn(ADD, ADD_ID));
|
|
expect(fingerprintMutants([ADD_ID], () => ADD).get(ADD_ID)?.fallback).toBeNull();
|
|
});
|
|
|
|
it.each([
|
|
['operator', ADD, idOf(ADD, '2:10-2:15', 'StringLiteral', 'a - b')],
|
|
['replacement', ADD, idOf(ADD, '2:10-2:15', 'ArithmeticOperator', 'a * b')],
|
|
[
|
|
'enclosing statement',
|
|
ADD.replace('a + b;', 'a + b + 0;'),
|
|
idOf(ADD.replace('a + b;', 'a + b + 0;'), '2:10-2:15', 'ArithmeticOperator', 'a - b'),
|
|
],
|
|
])('changes with the %s', (_part, source, id) => {
|
|
expect(fingerprintIn(source, id)).not.toBe(fingerprintIn(ADD, ADD_ID));
|
|
});
|
|
|
|
it('tells apart equal mutants of one statement by occurrence', () => {
|
|
const source = "export const k = f('a') + f('a');\n";
|
|
const first = idOf(source, '1:20-1:23', 'StringLiteral', '""');
|
|
const second = idOf(source, '1:29-1:32', 'StringLiteral', '""');
|
|
const result = fingerprintMutants([first, second], () => source);
|
|
expect(result.get(first)?.fingerprint).not.toBe(result.get(second)?.fingerprint);
|
|
});
|
|
|
|
it('takes a class member, not the whole class, as the enclosing statement', () => {
|
|
const before = "class K {\n s = new Set(['a']);\n m() { return 1; }\n}\n";
|
|
const after = before.replace('return 1', 'return 2');
|
|
const span = '2:16-2:19';
|
|
expect(fingerprintIn(after, idOf(after, span, 'StringLiteral', '""'))).toBe(
|
|
fingerprintIn(before, idOf(before, span, 'StringLiteral', '""')),
|
|
);
|
|
});
|
|
|
|
it.each<[FingerprintFallback, string, string | null]>([
|
|
['malformed-id', 'not-a-global-id', ADD],
|
|
['unreadable', ADD_ID, null],
|
|
['content-changed', ADD_ID, ADD.replace('a + b', 'b + a')],
|
|
[
|
|
'unparsable',
|
|
idOf('export const = ;\n', '1:1-1:2', 'StringLiteral', ''),
|
|
'export const = ;\n',
|
|
],
|
|
['span-outside', idOf(ADD, '9:1-9:2', 'ArithmeticOperator', 'a - b'), ADD],
|
|
['no-statement', idOf('a;\nb;\n', '1:1-2:3', 'BlockStatement', '{}'), 'a;\nb;\n'],
|
|
])('falls back to the global id when %s', (fallback, id, source) => {
|
|
expect(fingerprintMutants([id], () => source).get(id)?.fallback).toBe(fallback);
|
|
});
|
|
});
|
|
|
|
describe('universeIdOf', () => {
|
|
it('names a universe by its sorted fingerprints, whatever their order', () => {
|
|
expect(universeIdOf(['m2', 'm1'])).toBe(universeIdOf(['m1', 'm2']));
|
|
expect(universeIdOf(['m1'])).not.toBe(universeIdOf(['m1', 'm2']));
|
|
expect(universeIdOf([])).toBeNull();
|
|
});
|
|
});
|
|
|
|
// ── Evidence hashes (KTD13) ────────────────────────────────────────────────
|
|
|
|
describe('evidence hash', () => {
|
|
it('changes for every item on a verdict-engine version bump alone', () => {
|
|
const before = buildReport(reportInput());
|
|
const bumped = buildReport(
|
|
reportInput({
|
|
verdicts: (report) => ({ ...report, engineVersion: report.engineVersion + 1 }),
|
|
}),
|
|
);
|
|
const hashes = new Set(before.continuity.items.map((item) => item.evidenceHash));
|
|
expect(bumped.continuity.items).toHaveLength(before.continuity.items.length);
|
|
expect(bumped.continuity.items.filter((item) => hashes.has(item.evidenceHash))).toEqual([]);
|
|
});
|
|
|
|
it('stays when a regrouping leaves the common universe unchanged', () => {
|
|
const before = buildReport(reportInput());
|
|
const regrouped = buildReport(reportInput({ group: 'g-regrouped' }));
|
|
expect(regrouped.pairs.map((pair) => pair.group)).toEqual(['g-regrouped', 'g-regrouped']);
|
|
expect(regrouped.pairs[0].evidence.universeId).not.toBe(before.pairs[0].evidence.universeId);
|
|
expect(regrouped.pairs.map((pair) => pair.universe)).toEqual(
|
|
before.pairs.map((pair) => pair.universe),
|
|
);
|
|
expect(regrouped.continuity.items).toEqual(before.continuity.items);
|
|
});
|
|
|
|
it('changes when a mutant of the common universe changes', () => {
|
|
const before = buildReport(reportInput());
|
|
const renewed = fingerprints([M1, M2, M3]);
|
|
renewed.set(M2, { fingerprint: 'm-renewed', fallback: null });
|
|
const after = buildReport(reportInput({ overrides: { fingerprints: renewed } }));
|
|
expect(after.pairs[0].universe.id).not.toBe(before.pairs[0].universe.id);
|
|
expect(after.pairs[0].evidenceHash).not.toBe(before.pairs[0].evidenceHash);
|
|
});
|
|
|
|
it('is byte-identical for reordered observations', () => {
|
|
const input = reportInput();
|
|
const reordered = {
|
|
...input,
|
|
evidence: {
|
|
...input.evidence,
|
|
observations: {
|
|
...input.evidence.observations,
|
|
explicit: [...input.evidence.observations.explicit].reverse(),
|
|
},
|
|
},
|
|
};
|
|
expect(JSON.stringify(buildReport(reordered))).toBe(JSON.stringify(buildReport(input)));
|
|
});
|
|
});
|
|
|
|
// ── Spot audit (design §8) ─────────────────────────────────────────────────
|
|
|
|
const candidates = (count: number): SpotAuditPick[] =>
|
|
Array.from({ length: count }, (_, i) => ({ key: `pair:k${i}`, a: `a${i}`, b: `b${i}` }));
|
|
|
|
describe('spot audit', () => {
|
|
it('picks the same 10 candidates with seed s1 on two runs, in any input order', () => {
|
|
const first = spotAudit(candidates(25), 's1');
|
|
expect(first.picks).toHaveLength(10);
|
|
expect(spotAudit(candidates(25), 's1')).toEqual(first);
|
|
expect(spotAudit([...candidates(25)].reverse(), 's1')).toEqual(first);
|
|
expect(spotAudit(candidates(25), 's2').picks).not.toEqual(first.picks);
|
|
});
|
|
|
|
it('picks every candidate when there are fewer than 10', () => {
|
|
const audit = spotAudit(candidates(3), 's1');
|
|
expect(audit.picks.map((pick) => pick.key).sort()).toEqual(['pair:k0', 'pair:k1', 'pair:k2']);
|
|
expect(audit).toMatchObject({ seed: 's1', size: 10, candidates: 3 });
|
|
});
|
|
|
|
it('records the seed and samples the fingerprint duplicates of a report', () => {
|
|
const input = reportInput();
|
|
// B checks add(2, 3) as A does: the same path, input and expectation.
|
|
const facetOfA = input.evidence.tests.find((test) => test.id === A)?.facet ?? null;
|
|
const evidence = {
|
|
...input.evidence,
|
|
tests: input.evidence.tests.map((test) =>
|
|
test.id === B ? { ...test, facet: facetOfA } : test,
|
|
),
|
|
};
|
|
const report = buildReport({ ...input, fingerprint: computeFingerprints(evidence) });
|
|
const duplicates = report.fingerprint.pairs.filter((pair) => pair.verdict === 'duplicate');
|
|
expect(report.seed).toBe('s1');
|
|
expect(report.spotAudit.picks).toEqual(
|
|
duplicates.map((pair) => ({ key: pair.key, a: A, b: B })),
|
|
);
|
|
expect(duplicates).toHaveLength(1);
|
|
});
|
|
});
|
|
|
|
// ── Report sections ────────────────────────────────────────────────────────
|
|
|
|
describe('buildReport', () => {
|
|
it('carries the schema and engine versions, the verdicts and the limits', () => {
|
|
const report = buildReport(reportInput());
|
|
expect(report).toMatchObject({
|
|
schemaVersion: SCENARIO_MAP_SCHEMA_VERSION,
|
|
engineVersion: VERDICT_ENGINE_VERSION,
|
|
summary: {
|
|
byVerdict: { 'repeat-strong': 1, weak: 1 },
|
|
testsByStatus: { killing: 2, weak: 1 },
|
|
gapFiles: 1,
|
|
survived: 1,
|
|
uncovered: 1,
|
|
},
|
|
});
|
|
expect(report.pairs.map((pair) => [pair.a, pair.b, pair.verdict])).toEqual([
|
|
[A, B, 'repeat-strong'],
|
|
[A, C, 'weak'],
|
|
]);
|
|
expect(report.limits[0]).toBe(PRECISION_NOT_MEASURED);
|
|
expect(report.provenance.operators).toEqual({
|
|
mutator: null,
|
|
names: ['ArithmeticOperator', 'BlockStatement', 'ConditionalExpression'],
|
|
});
|
|
});
|
|
|
|
it('counts N of M eligible tests evaluated', () => {
|
|
const other = 'test/unit/other.test.ts#other > runs alone';
|
|
const report = buildReport(reportInput({ overrides: { eligibleTests: [A, B, C, other] } }));
|
|
expect(report.summary.evaluated).toBe('3 of 4 eligible tests evaluated');
|
|
});
|
|
|
|
it.each([
|
|
[
|
|
'an incomplete shard',
|
|
{ planned: 2, complete: 1, incomplete: [{ shard: '1', reason: 'timeout' }] },
|
|
false,
|
|
],
|
|
['every shard complete', { planned: 2, complete: 2, incomplete: [] }, true],
|
|
])('records completeness with %s', (_title, shards, complete) => {
|
|
const report = buildReport(reportInput({ degraded: ['no-pdg-layer'], overrides: { shards } }));
|
|
expect(report.completeness).toMatchObject({
|
|
complete,
|
|
partial: !complete,
|
|
degraded: ['no-pdg-layer'],
|
|
});
|
|
});
|
|
|
|
it('keeps the Layer 0 findings of eligible files only', () => {
|
|
const finding = (file: string) => ({
|
|
kind: 'same-test',
|
|
file,
|
|
line: 3,
|
|
matches: [],
|
|
detail: 'same body',
|
|
});
|
|
const layer0 = {
|
|
version: 1,
|
|
scanned: 2,
|
|
skipped: [],
|
|
findings: [
|
|
finding('gitnexus/test/unit/other.test.ts'),
|
|
finding('gitnexus/test/unit/add.test.ts'),
|
|
],
|
|
};
|
|
const report = buildReport(reportInput({ overrides: { layer0 } }));
|
|
expect(report.layer0).toEqual({
|
|
available: true,
|
|
scanned: 2,
|
|
findings: [finding('gitnexus/test/unit/add.test.ts')],
|
|
skipped: [],
|
|
});
|
|
});
|
|
|
|
it('gives a test without a static join an execution-identity anchor', () => {
|
|
const report = buildReport(reportInput({ overrides: { anchors: new Map() } }));
|
|
expect(report.tests.map((test) => test.anchor.key.startsWith('exec:'))).toEqual([
|
|
true,
|
|
true,
|
|
true,
|
|
]);
|
|
expect(report.tests.map((test) => test.anchor.rowFingerprint)).toEqual([null, null, null]);
|
|
});
|
|
});
|
|
|
|
// ── Provenance (KTD15) ─────────────────────────────────────────────────────
|
|
|
|
const tempRoot = mkdtempSync(path.join(os.tmpdir(), 'scenario-map-report-'));
|
|
afterAll(() => rmSync(tempRoot, { recursive: true, force: true }));
|
|
|
|
const writeRepoFile = (repoPath: string, text: string): void => {
|
|
mkdirSync(path.dirname(path.join(tempRoot, repoPath)), { recursive: true });
|
|
writeFileSync(path.join(tempRoot, repoPath), text);
|
|
};
|
|
|
|
describe('collectProvenance', () => {
|
|
writeRepoFile('gitnexus/test/unit/a.test.ts', 'test text');
|
|
writeRepoFile('gitnexus/src/x.ts', 'production text');
|
|
writeRepoFile('gitnexus/package-lock.json', '{}');
|
|
writeRepoFile('gitnexus/node_modules/vitest/package.json', '{"version":"5.0.1"}');
|
|
writeRepoFile('gitnexus/tools/mutation/runner/plugin.ts', 'runner');
|
|
const provenance = collectProvenance({
|
|
repoRoot: tempRoot,
|
|
testFiles: ['test/unit/a.test.ts'],
|
|
productionFiles: ['gitnexus/src/x.ts'],
|
|
fixtureFiles: ['gitnexus/test/fixtures/missing.json'],
|
|
sourceRevision: 'abc',
|
|
env: {
|
|
GITNEXUS_HOME: '/h',
|
|
GITNEXUS_API_KEY: 'secret',
|
|
GITNEXUS_MCP_DEFAULT_MAX_TOKENS: '5',
|
|
PATH: '/bin',
|
|
},
|
|
node: 'v24.1.0',
|
|
os: 'linux test x64',
|
|
});
|
|
|
|
it('hashes test, production and fixture files and the lockfiles', () => {
|
|
expect(provenance.files).toEqual({
|
|
tests: { 'test/unit/a.test.ts': sha256('test text') },
|
|
production: { 'gitnexus/src/x.ts': sha256('production text') },
|
|
fixtures: { 'gitnexus/test/fixtures/missing.json': 'absent' },
|
|
});
|
|
expect(provenance.lockfiles).toEqual({
|
|
'gitnexus-shared/package-lock.json': 'absent',
|
|
'gitnexus/package-lock.json': sha256('{}'),
|
|
});
|
|
});
|
|
|
|
it('records versions, runtime and only the GITNEXUS_ variables, secrets redacted', () => {
|
|
expect(provenance.versions).toMatchObject({ vitest: '5.0.1', stryker: null, typescript: null });
|
|
expect(provenance.versions.runner).toMatch(/^[0-9a-f]{64}$/);
|
|
expect(provenance.runtime).toEqual({
|
|
node: 'v24.1.0',
|
|
os: 'linux test x64',
|
|
env: {
|
|
GITNEXUS_API_KEY: REDACTED,
|
|
GITNEXUS_HOME: '/h',
|
|
GITNEXUS_MCP_DEFAULT_MAX_TOKENS: '5',
|
|
},
|
|
});
|
|
expect(provenance.sourceRevision).toBe('abc');
|
|
});
|
|
});
|
|
|
|
// ── Markdown ───────────────────────────────────────────────────────────────
|
|
|
|
describe('renderMarkdown', () => {
|
|
const markdown = renderMarkdown(buildReport(reportInput()));
|
|
|
|
it.each([
|
|
{
|
|
scope: 'a whole-suite run that ran every file',
|
|
overrides: {},
|
|
lines: [],
|
|
},
|
|
{
|
|
scope: 'a whole-suite run that skipped files',
|
|
overrides: { layer1Files: 0 },
|
|
lines: ['Layer 1 ran 0 of them; the other 1 file was not compared.'],
|
|
},
|
|
{
|
|
scope: 'a diff-scoped run',
|
|
overrides: { layer1Files: 0, changedFiles: ['test/unit/add.test.ts'] },
|
|
lines: [
|
|
'Diff scope: only pairs with a test in the 1 changed test file were looked for: ' +
|
|
'`test/unit/add.test.ts`.',
|
|
'Layer 1 ran 0 of them: the changed files whose tests can pair with another test',
|
|
],
|
|
},
|
|
{
|
|
scope: 'a run with a file that wrote no record',
|
|
overrides: { unrecordedFiles: 2 },
|
|
lines: ['2 test files wrote no Layer 1 record'],
|
|
},
|
|
{
|
|
scope: 'a run with tests that did not run',
|
|
overrides: { notRun: { skipped: 3, unfinished: 1 } },
|
|
lines: ['No fingerprint for 3 tests skipped at run time'],
|
|
},
|
|
])('says which files Layer 1 ran in $scope', ({ overrides, lines }) => {
|
|
const text = renderMarkdown(buildReport(reportInput({ overrides })));
|
|
const found = text
|
|
.split('\n')
|
|
.filter((line) =>
|
|
/^(Diff scope|Layer 1 ran|No fingerprint for|\d+ test files? wrote no)/.test(line),
|
|
);
|
|
expect(found).toEqual(lines.map((prefix) => expect.stringContaining(prefix)));
|
|
});
|
|
|
|
it('leads with the scenario fingerprint and leaves the mutation sections out of a fingerprint-only run', () => {
|
|
const fingerprintOnly = renderMarkdown(buildReport({ ...reportInput(), mutation: 'none' }));
|
|
expect([
|
|
fingerprintOnly.includes('## Scenario fingerprint'),
|
|
fingerprintOnly.includes('## Table-row candidates (1)'),
|
|
fingerprintOnly.includes('**Mutation evidence**: not gathered'),
|
|
fingerprintOnly.includes('## Strong repeat candidates'),
|
|
]).toEqual([true, true, true, false]);
|
|
});
|
|
|
|
it.each([
|
|
['the title', '# Test scenario map'],
|
|
['N of M', '**3 of 3 eligible tests evaluated.**'],
|
|
['the precision statement', PRECISION_NOT_MEASURED],
|
|
['the baseline banner', 'first run, no baseline'],
|
|
['the strong repeats', '## Strong repeat candidates (1)'],
|
|
['the spot audit seed', '## Spot audit (seed `s1`'],
|
|
['the weak tests', '## Weak tests (1)'],
|
|
['the gap file', `| ${mdCode(FILE)} |`],
|
|
['a strong pair member', mdCode(A)],
|
|
])('shows %s', (_title, text) => {
|
|
expect(markdown).toContain(text);
|
|
});
|
|
|
|
it.each([
|
|
['plain text', 'a > b', '`a > b`'],
|
|
['a pipe', 'a | b', '`a \\| b`'],
|
|
['a backtick', 'a `b`', '`` a `b` ``'],
|
|
['a newline', 'a\nb', '`a b`'],
|
|
])('renders %s as an inline code cell', (_title, text, expected) => {
|
|
expect(mdCode(text)).toBe(expected);
|
|
});
|
|
});
|