File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ A collection of helper TypeScript types to test other TypeScript types. This col
18
18
- IsNonUndefined - Check if a type is not undefined
19
19
- IsNullish - Check if a type is either undefined or null
20
20
- IsNonNullish - Check if a type is neither undefined or null
21
+
21
22
## Installation
22
23
23
24
To install ` ts-test-utils ` with Bun, run the following command:
@@ -44,6 +45,19 @@ that a `false` return is expected, and that a match is not expected:
44
45
type ResultRecord = Expect<Equals<{ id: number }, { id: string }>>
45
46
` ` `
46
47
48
+ You can combine these types with existing types . As an example ,
49
+ here is the ' Equals' type being used to check a functions return type:
50
+
51
+ ` ` ` typescript
52
+ function myFunction() {
53
+ return {
54
+ id: 1,
55
+ name: 'Craig',
56
+ }
57
+ }
58
+ type Result = Expect<Equals<ReturnType<typeof myFunction>, { id: number, name: string }>>
59
+ ` ` `
60
+
47
61
## Development Installation
48
62
49
63
To install dependencies :
You can’t perform that action at this time.
0 commit comments