import { expectTypeOf, it } from "@effect/vitest" import { type Layer } from "effect" import { type LayerUtils } from "../src/api/layerUtils.js" it("works", () => { // not supported atm, resolves to unknown! // type None = LayerUtils.GetLayersContext type B = (Layer.Layer | Layer.Layer)[] type C = LayerUtils.GetLayersContext type CE = LayerUtils.GetLayersError expectTypeOf({} as C).toEqualTypeOf<"a" | "b">() expectTypeOf({} as CE).toEqualTypeOf<"error-a" | "error-b">() // expectTypeOf({} as None).toEqualTypeOf() type B2 = [Layer.Layer, Layer.Layer | Layer.Layer] type C2 = LayerUtils.GetLayersContext type CE2 = LayerUtils.GetLayersError expectTypeOf({} as C2).toEqualTypeOf<"a" | "b" | "c">() expectTypeOf({} as CE2).toEqualTypeOf<"error-a" | "error-b" | "error-c">() })