Skip to content

Commit

Permalink
update test matrix, remove pre41 annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Apr 17, 2022
1 parent 515b09d commit 04a9799
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
fail-fast: false
matrix:
node: ['14.x']
ts: ['4.1', '4.2', '4.3', '4.4', '4.5', '4.6.1-rc', 'next']
ts: ['4.1', '4.2', '4.3', '4.4', '4.5', '4.6', '4.7.0-beta', 'next']
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -123,10 +123,6 @@ jobs:

- run: sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./jest.config.js ./src/tests/*.* ./src/query/tests/*.*

- name: "@ts-ignore stuff that didn't exist pre-4.1 in the tests"
if: ${{ matrix.ts < 4.1 }}
run: sed -i -e 's/@pre41-ts-ignore/@ts-ignore/' -e '/pre41-remove-start/,/pre41-remove-end/d' ./src/tests/*.* ./src/query/tests/*.ts*

- name: Test types
run: |
yarn tsc --version
Expand Down
4 changes: 0 additions & 4 deletions packages/toolkit/src/query/tests/buildHooks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1828,14 +1828,10 @@ describe('hooks with createApi defaults set', () => {

const storeRef = setupApiStore(api)

// @pre41-ts-ignore
expectExactType(api.useGetPostsQuery)(api.endpoints.getPosts.useQuery)
// @pre41-ts-ignore
expectExactType(api.useUpdatePostMutation)(
// @pre41-ts-ignore
api.endpoints.updatePost.useMutation
)
// @pre41-ts-ignore
expectExactType(api.useAddPostMutation)(api.endpoints.addPost.useMutation)

test('useQueryState serves a deeply memoized value and does not rerender unnecessarily', async () => {
Expand Down
6 changes: 0 additions & 6 deletions packages/toolkit/src/query/tests/unionTypes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ describe.skip('TS only tests', () => {
expectType<never>(result)
}
})
// pre41-remove-start
test('useQuery TS4.1 union', () => {
const result = api.useTestQuery()

Expand Down Expand Up @@ -207,7 +206,6 @@ describe.skip('TS only tests', () => {
expectType<never>(result)
}
})
// pre41-remove-end

test('useLazyQuery union', () => {
const [_trigger, result] = api.endpoints.test.useLazyQuery()
Expand Down Expand Up @@ -275,7 +273,6 @@ describe.skip('TS only tests', () => {
}
})

// pre41-remove-start
test('useLazyQuery TS4.1 union', () => {
const [_trigger, result] = api.useLazyTestQuery()

Expand Down Expand Up @@ -341,7 +338,6 @@ describe.skip('TS only tests', () => {
expectType<never>(result)
}
})
// pre41-remove-end

test('queryHookResult (without selector) union', () => {
const useQueryStateResult = api.endpoints.test.useQueryState()
Expand Down Expand Up @@ -501,7 +497,6 @@ describe.skip('TS only tests', () => {
})(result)
})

// pre41-remove-start
test('useMutation TS4.1 union', () => {
const [_trigger, result] = api.useMutationMutation()

Expand Down Expand Up @@ -552,5 +547,4 @@ describe.skip('TS only tests', () => {
expectType<never>(result)
}
})
// pre41-remove-end
})

0 comments on commit 04a9799

Please sign in to comment.