Skip to content

Commit ea4cba2

Browse files
committed
add type level test for PR #5360
1 parent 3b26094 commit ea4cba2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/effect/dtslint/Schema/Brand.tst.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars */
22
import { pipe, Schema } from "effect"
3-
import { describe, expect, it } from "tstyche"
3+
import { describe, expect, it, when } from "tstyche"
44

55
const Int1 = Symbol.for("Int")
66
const Int2 = Symbol.for("Int")
@@ -16,4 +16,13 @@ describe("SchemaBrand", () => {
1616
expect<A1>().type.not.toBeAssignableTo<A2>()
1717
expect<A2>().type.not.toBeAssignableTo<A1>()
1818
})
19+
20+
it("should raise an error when the brand is not assignable to the schema", () => {
21+
when(pipe).isCalledWith(
22+
Schema.Number,
23+
expect(Schema.brand).type.not.toBeCallableWith("UserId", {
24+
examples: ["a"]
25+
})
26+
)
27+
})
1928
})

0 commit comments

Comments
 (0)