Skip to content

Commit

Permalink
put code on one line, to account for error in different versions
Browse files Browse the repository at this point in the history
  • Loading branch information
EskiMojo14 committed Jun 19, 2024
1 parent dc08e93 commit 675f261
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
11 changes: 3 additions & 8 deletions packages/toolkit/src/query/tests/createApi.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,9 @@ describe('type tests', () => {
withoutTestLifecycles: true,
})

// @ts-expect-error
api1
.enhanceEndpoint('query1', {
providesTags: ['new'],
})
.enhanceEndpoint('query2', {
providesTags: ['missing'],
})
// @ts-expect-error the location of the error varies depending on TS version, so this needs to be one line
// prettier-ignore
api1.enhanceEndpoint('query1', { providesTags: ['new'] }).enhanceEndpoint('query2', { providesTags: ['missing'] })

const enhanced = api1
.addTagTypes('new')
Expand Down
12 changes: 3 additions & 9 deletions packages/toolkit/src/query/tests/createApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,9 @@ describe('endpoint definition typings', () => {
})
}

// @ts-expect-error
const enhanced = api
.addTagTypes('new')
.enhanceEndpoint('query1', {
providesTags: ['new'],
})
.enhanceEndpoint('query2', {
providesTags: ['missing'],
})
// @ts-expect-error the location of the error varies depending on TS version, so this needs to be one line
// prettier-ignore
const enhanced = api.addTagTypes('new').enhanceEndpoint('query1', { providesTags: ['new'] }).enhanceEndpoint('query2', { providesTags: ['missing'] })

storeRef.store.dispatch(api.endpoints.query1.initiate('in1'))
await delay(1)
Expand Down

0 comments on commit 675f261

Please sign in to comment.