Download react-query/packages/vue-query/src/__tests__/mutationCache.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/vue-query/src/__tests__/mutationCache.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/vue-query/src/__tests__/mutationCache.test.ts
-
curl -L -o mutationCache.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/vue-query/src/__tests__/mutationCache.test.ts
1.04 kB
| import { beforeAll, describe, expect, test, vi } from 'vitest' | |
| import { ref } from 'vue-demi' | |
| import { MutationCache as MutationCacheOrigin } from '@tanstack/query-core' | |
| import { MutationCache } from '../mutationCache' | |
| describe('MutationCache', () => { | |
| beforeAll(() => { | |
| vi.spyOn(MutationCacheOrigin.prototype, 'find') | |
| vi.spyOn(MutationCacheOrigin.prototype, 'findAll') | |
| }) | |
| describe('find', () => { | |
| test('should properly unwrap parameters', () => { | |
| const mutationCache = new MutationCache() | |
| mutationCache.find({ | |
| mutationKey: ref(['baz']), | |
| }) | |
| expect(MutationCacheOrigin.prototype.find).toBeCalledWith({ | |
| mutationKey: ['baz'], | |
| }) | |
| }) | |
| }) | |
| describe('findAll', () => { | |
| test('should properly unwrap parameters', () => { | |
| const mutationCache = new MutationCache() | |
| mutationCache.findAll({ | |
| mutationKey: ref(['baz']), | |
| }) | |
| expect(MutationCacheOrigin.prototype.findAll).toBeCalledWith({ | |
| mutationKey: ['baz'], | |
| }) | |
| }) | |
| }) | |
| }) | |