fix startup packaging and content guardrails
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
import { applyFeynmanPackageManagerEnv, buildPiArgs, buildPiEnv, resolvePiPaths } from "../src/pi/runtime.js";
|
||||
import { applyFeynmanPackageManagerEnv, buildPiArgs, buildPiEnv, resolvePiPaths, toNodeImportSpecifier } from "../src/pi/runtime.js";
|
||||
|
||||
test("buildPiArgs includes configured runtime paths and prompt", () => {
|
||||
const args = buildPiArgs({
|
||||
@@ -106,3 +107,11 @@ test("resolvePiPaths includes the Promise.withResolvers polyfill path", () => {
|
||||
|
||||
assert.equal(paths.promisePolyfillPath, "/repo/feynman/dist/system/promise-polyfill.js");
|
||||
});
|
||||
|
||||
test("toNodeImportSpecifier converts absolute preload paths to file URLs", () => {
|
||||
assert.equal(
|
||||
toNodeImportSpecifier("/repo/feynman/dist/system/promise-polyfill.js"),
|
||||
pathToFileURL("/repo/feynman/dist/system/promise-polyfill.js").href,
|
||||
);
|
||||
assert.equal(toNodeImportSpecifier("tsx"), "tsx");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user