Skip to content

Commit

Permalink
test for type errors where we want, too
Browse files Browse the repository at this point in the history
  • Loading branch information
ptpaterson committed Jul 24, 2024
1 parent 8facc3b commit 045b479
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions __tests__/integration/query-typings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,10 @@ describe.each`

const result = (await client.query<string | number>(query)).data;
expect(result).toEqual("hello");

// And make sure that the opposite is not possible
const query2 = fql<string | number>`"hello"`;
// @ts-expect-error Argument of type 'Query<string | number>' is not assignable to parameter of type 'Query<string>'.
await client.query<string>(query2);
});
});

0 comments on commit 045b479

Please sign in to comment.