Skip to content

Commit

Permalink
Add as const to fix failing type test in TypeScript v4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Nov 13, 2024
1 parent dd7478e commit 2199c0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/toolkit/src/query/tests/queryLifecycle.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ describe('type tests', () => {
dispatch(
baseApiSlice.util.upsertQueryEntries(
posts.map((post) => ({
endpointName: 'getPostById',
// Without `as const` this will result in a TS error in TS 4.7.
endpointName: 'getPostById' as const,
arg: post.id,
value: post,
})),
Expand Down

0 comments on commit 2199c0a

Please sign in to comment.