Skip to content

Commit

Permalink
improve Entity type test
Browse files Browse the repository at this point in the history
  • Loading branch information
wernst committed Jun 12, 2024
1 parent a858fd4 commit f7d20d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/client/test/typecheck/friendly-types.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ test('Entity', () => {
a: {
schema: S.Schema({
id: S.Id(),
attr: S.String(),
a_attr: S.String(),
rel: S.RelationById('b', '$bId'),
}),
},
b: {
schema: S.Schema({
id: S.Id(),
attr: S.String(),
b_attr: S.String(),
}),
},
};
expectTypeOf<Entity<typeof schema, 'a'>>().toEqualTypeOf<{
id: string;
attr: string;
a_attr: string;
}>();
expectTypeOf<Entity<typeof schema, 'b'>>().toEqualTypeOf<{
id: string;
b_attr: string;
}>();
});

0 comments on commit f7d20d8

Please sign in to comment.