test(sync): implement test-strategy Phase 1-2 (pure unit/golden/property), +102 tests
Work through test-strategy-report.md, high-ROI no-refactor subset (no regen). - R-Infra: vitest resolve.alias docmost-client -> packages/docmost-client/src (fixes the dist-vs-src coverage artifact: canonicalize 0% -> real) - R-Cfg-1: export parseArgs + tests - canonicalize: align family / comment.resolved kept / link non-default + fixpoint & docsCanonicallyEqual reflexive/symmetric properties (0 -> 100%) - markdown-converter golden matrix: columns/embed/audio/pdf, drawio data-align rule, inline-mark matrix, textAlign, escaping idempotence, table sanitization (61 -> 79%) - schema parse-closures via generateJSON (TextStyle/comment/mention/Highlight/Column) - node-ops (immutability, table edge cases, makeFreshId property), transforms (setCalloutRange/insertMarkerAfter/commentsToFootnotes + renumber property) - stabilize normalize-on-write fixpoint (0 -> 100%); diff coarse-fallback; client-utils; firstDivergence; corpus fixtures details/columns/mention - 593 -> 695 green; build clean; corpus STABLE Deferred (Phase 3-4, refactor-gated): pull/collab/client-REST/git-merge integration.
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import path from 'node:path';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
// R-Infra (test-strategy report §1/§5): tests that import from the package
|
||||
// barrel (`docmost-client`) otherwise resolve to the package `main` (the stale
|
||||
// compiled `dist/index.js`), so v8 coverage measures `src` while the tests run
|
||||
// against `dist`. `canonicalize.ts` in particular reads 0% despite 22 green
|
||||
// tests. Aliasing the barrel specifier to the package's `src/index.ts` makes
|
||||
// barrel-imported tests both run and be measured against `src`.
|
||||
const here = path.dirname(fileURLToPath(import.meta.url));
|
||||
const clientSrcBarrel = path.resolve(
|
||||
here,
|
||||
'packages/docmost-client/src/index.ts',
|
||||
);
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
'docmost-client': clientSrcBarrel,
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: 'node',
|
||||
include: ['test/**/*.test.ts'],
|
||||
|
||||
Reference in New Issue
Block a user