jacobinwwey_obsidian-NotEMD/jest.config.js
Jacobinwwey eb777ef93e fix(slide-export): cross-page mermaid/heading integrity, MP4 order+clarity, Windows probe
Slide export improvements across all 6 formats (HTML standalone, HTML
server-script, PDF, PNG, PPTX, MP4):

Cross-page split integrity:
- isTopLevelListItem now anchors to column 0 only, so indented nested
  children (e.g. - Responsibility: under - Module:) stay attached to
  their parent block instead of being orphaned as top-level items on the
  next slide. Regression test added.

PDF/PNG Mermaid blank pages:
- Slidev one-piece export only waits on one shared #mermaid-rendering-container,
  so late Mermaid blocks capture blank. Append --per-slide to PDF/PNG CLI
  invocations so each slide gets its own Mermaid container-wait cycle.
  Keep --wait-until networkidle --wait 3000 as belt-and-suspenders.
  PDF p3 content went 0.00% -> 2.64%.

MP4 slide ordering:
- Replace shell glob (*.png, lexicographic: 1,10,11,...,2) with a
  numerically-sorted concat-demuxer list fed to ffmpeg with explicit
  per-frame durations. Slides encode in deck order regardless of
  zero-padding width or --with-clicks suffix.

Image clarity setting (>=300 ppi default):
- Add slideExportImageClarity setting (standard/high/ultra, default ultra
  = scale 3 ~432 ppi) wired into Slidev --scale on PNG export; MP4
  inherits via PNG sequence. Settings UI dropdown in EN + ZH.
- Add -vf pad=ceil(iw/2)*2:ceil(ih/2)*2 to ffmpeg args so libx264/yuv420p
  encodes odd-height frames (scale 3 -> 2940x1653 -> 1654 padded).

Windows spawn EINVAL on environment probe:
- execFileAsync sets shell:true + windowsHide:true on win32 only so Node
  resolves PATHEXT for .cmd/.bat/.exe shims (npx.cmd, slidev.cmd, ffmpeg).
  macOS/Linux keep direct exec (shell:false), unchanged.
- resolvePlaywrightBrowsersPath covers AppData/Roaming/ms-playwright and
  PLAYWRIGHT_BROWSERS_PATH env var.

Mermaid pre-fit in standalone HTML:
- Inject mermaidPostFitScript into standalone HTML via main.ts export path.
- Add mermaidFitScript.ts, mermaidPostFitScript.txt, assets.d.ts.
- esbuild .txt loader, jest txt transform.

Tests: 1557 pass (1 pre-existing mainlineProgressAuditContract GEO drift
unrelated). tsc clean. Built main.js verified in live Obsidian.
2026-07-01 10:26:57 -05:00

22 lines
729 B
JavaScript

module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'js', 'json', 'txt'],
testMatch: ['**/tests/**/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', '/ref/', '/.worktrees/', '/.cache/', '/.tmp_repo_saga_tool/'],
modulePathIgnorePatterns: ['<rootDir>/.worktrees/', '<rootDir>/.cache/', '<rootDir>/.tmp_repo_saga_tool/', '<rootDir>/ref/'],
moduleNameMapper: {
'^obsidian$': '<rootDir>/src/__mocks__/obsidian.ts',
'^mermaid$': '<rootDir>/src/__mocks__/mermaid.ts'
},
transform: {
'^.+\\.txt$': '<rootDir>/jest-txt-transform.js',
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
diagnostics: false
}
]
}
};