Skip to content

Commit 82cc028

Browse files
committed
test(query-test-utils/createKey): change the key prefix from 'query_' to 'key_' since it is also used for mutation keys
1 parent f2bc921 commit 82cc028

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/query-test-utils/src/__tests__/createKey.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createKey } from '../createKey'
44
describe('createKey', () => {
55
it('should return a key', () => {
66
const key = createKey()
7-
expect(key).toStrictEqual(['query_1'])
7+
expect(key).toStrictEqual(['key_1'])
88
})
99

1010
it('should return a new key each time', () => {

‎packages/query-test-utils/src/createKey.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ let keyCount = 0
33
/**
44
* Creates a key that no other call returns, to use as a `queryKey` or
55
* `mutationKey` so tests don't share cache entries.
6-
* @returns A new key like `['query_1']`.
6+
* @returns A new key like `['key_1']`.
77
*/
88
export const createKey = (): Array<string> => {
99
keyCount++
10-
return [`query_${keyCount}`]
10+
return [`key_${keyCount}`]
1111
}

0 commit comments

Comments
 (0)