From 3abce0bc8015d77bdec777defd73255afd5d42fb Mon Sep 17 00:00:00 2001 From: Tate Lyman Date: Sat, 16 May 2026 14:36:03 -0500 Subject: [PATCH] test: handle file url paths with spaces --- VERSION | 2 +- test/e2e.mjs | 3 ++- test/free-model-matrix.mjs | 3 ++- test/local.mjs | 6 +++--- test/skills.local.mjs | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index e0d61b5b..c5b45eb7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.9.4 +3.18.0 diff --git a/test/e2e.mjs b/test/e2e.mjs index 73164c37..633854d3 100644 --- a/test/e2e.mjs +++ b/test/e2e.mjs @@ -29,8 +29,9 @@ import { spawn } from 'node:child_process'; import { mkdirSync, writeFileSync, readFileSync, existsSync, rmSync } from 'node:fs'; import { join } from 'node:path'; import { tmpdir } from 'node:os'; +import { fileURLToPath } from 'node:url'; -const DIST = new URL('../dist/index.js', import.meta.url).pathname; +const DIST = fileURLToPath(new URL('../dist/index.js', import.meta.url)); const TIMEOUT_MS = 90_000; // 90s per test — model calls can be slow // ─── Helper ──────────────────────────────────────────────────────────────── diff --git a/test/free-model-matrix.mjs b/test/free-model-matrix.mjs index ac8c70f2..8f50f526 100644 --- a/test/free-model-matrix.mjs +++ b/test/free-model-matrix.mjs @@ -16,8 +16,9 @@ import { test } from 'node:test'; import assert from 'node:assert/strict'; import { spawn } from 'node:child_process'; import { tmpdir } from 'node:os'; +import { fileURLToPath } from 'node:url'; -const DIST = new URL('../dist/index.js', import.meta.url).pathname; +const DIST = fileURLToPath(new URL('../dist/index.js', import.meta.url)); const TIMEOUT_MS = Number.parseInt(process.env.FREE_MODEL_MATRIX_TIMEOUT_MS || '180000', 10); const { MODEL_PRICING, estimateCost } = await import('../dist/pricing.js'); diff --git a/test/local.mjs b/test/local.mjs index 0a6ab175..44d74600 100644 --- a/test/local.mjs +++ b/test/local.mjs @@ -32,7 +32,7 @@ import { dirname, join } from 'node:path'; import { homedir, tmpdir } from 'node:os'; import { fileURLToPath } from 'node:url'; -const DIST = new URL('../dist/index.js', import.meta.url).pathname; +const DIST = fileURLToPath(new URL('../dist/index.js', import.meta.url)); const REPO_ROOT = fileURLToPath(new URL('..', import.meta.url)); function runCli(prompt = '', { cwd, timeoutMs = 15_000, args, env } = {}) { @@ -818,7 +818,7 @@ test('resume: second interactiveSession with resumeSessionId continues prior tra test('pruneOldSessions removes stale ghost sessions even when visible session count is below the cap', async () => { const fakeHome = mkdtempSync(join(tmpdir(), 'franklin-ghost-prune-')); - const storagePath = new URL('../dist/session/storage.js', import.meta.url).pathname; + const storagePath = fileURLToPath(new URL('../dist/session/storage.js', import.meta.url)); try { const sessionsDir = join(fakeHome, '.blockrun', 'sessions'); @@ -895,7 +895,7 @@ test('pruneOldSessions removes stale ghost sessions even when visible session co test('session meta imported flag can be set and survives later updates', async () => { const fakeHome = mkdtempSync(join(tmpdir(), 'franklin-imported-meta-')); - const storagePath = new URL('../dist/session/storage.js', import.meta.url).pathname; + const storagePath = fileURLToPath(new URL('../dist/session/storage.js', import.meta.url)); try { const result = await new Promise((resolve, reject) => { const proc = spawn('node', [ diff --git a/test/skills.local.mjs b/test/skills.local.mjs index 152c568a..0f3121c6 100644 --- a/test/skills.local.mjs +++ b/test/skills.local.mjs @@ -11,13 +11,14 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { tmpdir } from 'node:os'; import { spawn } from 'node:child_process'; +import { fileURLToPath } from 'node:url'; import { parseSkill, loadSkillsFromDir } from '../dist/skills/loader.js'; import { substituteVariables, matchSkill } from '../dist/skills/invoke.js'; import { Registry } from '../dist/skills/registry.js'; import { loadBundledSkills, getSkillVars } from '../dist/skills/bootstrap.js'; -const DIST = new URL('../dist/index.js', import.meta.url).pathname; +const DIST = fileURLToPath(new URL('../dist/index.js', import.meta.url)); function runCli(args, { timeoutMs = 8000 } = {}) { return new Promise((resolve, reject) => {