fix: avoid truncate permission import cycle (#18292)

This commit is contained in:
Luke Parker
2026-03-20 13:52:04 +10:00
committed by GitHub
parent e71a21e0a8
commit 7866dbcfcc
4 changed files with 30 additions and 8 deletions

View File

@@ -4,12 +4,14 @@ import { Effect, FileSystem, Layer } from "effect"
import { Truncate } from "../../src/tool/truncate"
import { TruncateEffect } from "../../src/tool/truncate-effect"
import { Identifier } from "../../src/id/id"
import { Process } from "../../src/util/process"
import { Filesystem } from "../../src/util/filesystem"
import path from "path"
import { testEffect } from "../lib/effect"
import { writeFileStringScoped } from "../lib/filesystem"
const FIXTURES_DIR = path.join(import.meta.dir, "fixtures")
const ROOT = path.resolve(import.meta.dir, "..", "..")
describe("Truncate", () => {
describe("output", () => {
@@ -125,6 +127,14 @@ describe("Truncate", () => {
if (result.truncated) throw new Error("expected not truncated")
expect("outputPath" in result).toBe(false)
})
test("loads truncate effect in a fresh process", async () => {
const out = await Process.run([process.execPath, "run", path.join(ROOT, "src", "tool", "truncate-effect.ts")], {
cwd: ROOT,
})
expect(out.code).toBe(0)
}, 20000)
})
describe("cleanup", () => {