Skip to content

Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.

fix(loop): use pathToFileURL for dynamic import in files.test (Windows) (#502)

tayyabhussain29105b57ddc1d2ae
diff --git a/tools/loop/test/files.test.mjs b/tools/loop/test/files.test.mjs
index 49086ba..ebd1eee 100644
--- a/tools/loop/test/files.test.mjs
+++ b/tools/loop/test/files.test.mjs
@@ -1,10 +1,10 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import path from 'node:path';
-import { fileURLToPath } from 'node:url';
+import { fileURLToPath, pathToFileURL } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
-const files = await import(path.resolve(__dirname, '../dist/files.js'));
+const files = await import(pathToFileURL(path.resolve(__dirname, '../dist/files.js')).href);
test('parseRunLog extracts trailing JSON lines newest first', () => {
const content = `