Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
node: [20, 22]
# Windows on 22 only: cmd.exe leaves test/*.test.mjs unexpanded, and
# node --test expands globs itself only from Node 21
include:
- os: windows-latest
node: 22
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
Expand Down
5 changes: 3 additions & 2 deletions test/export.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import assert from 'node:assert/strict';
import { mkdtempSync, writeFileSync, readFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { pathToFileURL } from 'node:url';
import { renderSpec } from '../skills/seecode/scripts/lib/render.mjs';
import { exportDiagram, launchBrowser } from '../skills/seecode/scripts/lib/export/export.mjs';

Expand Down Expand Up @@ -47,7 +48,7 @@ test('the HTML exports PNG/SVG/GIF/MP4 by itself (in-page menu)', { skip, timeou
const { browser } = await launch();
try {
const p = await browser.newPage({ viewport: { width: 1200, height: 700 } });
await p.goto(`file://${html}`);
await p.goto(pathToFileURL(html).href);
for (const kind of ['png', 'svg', 'gif', 'mp4']) {
const r = await p.evaluate(async (k) => {
window.SeeCode.lastExport = null;
Expand Down Expand Up @@ -82,7 +83,7 @@ test('export size adapts to the content', { skip, timeout: 60000 }, async () =>
const html = join(dir, `${name}.html`);
writeFileSync(html, renderSpec(spec).html);
const p = await browser.newPage({ viewport: { width: 1200, height: 700 } });
await p.goto(`file://${html}`);
await p.goto(pathToFileURL(html).href);
plans[name] = await p.evaluate(() => Object.fromEntries(['png', 'gif', 'mp4'].map((f) => [f, window.SeeCode.exportPlan(f)])));
await p.close();
}
Expand Down
Loading