t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/Prisma/BundlePaths.test.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

33 lines
971 B
TypeScript

import { normalizeBundleFilePath } from "@/Prisma/Internal/BundlePaths";
import { describe, expect, it } from "alchemy-test";
import * as Effect from "effect/Effect";
describe(
"Prisma Compute bundle paths",
{ tags: ["unit", "provider:prisma", "local"] },
() => {
it.effect("accepts normalized relative bundle paths", () =>
Effect.gen(function* () {
expect(yield* normalizeBundleFilePath("chunks/api.js")).toBe(
"chunks/api.js",
);
}),
);
it.effect("rejects empty, absolute, and traversal bundle paths", () =>
Effect.gen(function* () {
for (const path of [
"",
"/tmp/escape.js",
"C:\\tmp\\escape.js",
"../escape.js",
"chunks/../../escape.js",
"chunks//escape.js",
]) {
const error = yield* normalizeBundleFilePath(path).pipe(Effect.flip);
expect(error).toBeInstanceOf(Error);
}
}),
);
},
);