Skip to content

Commit ccd9357

Browse files
committed
test: refactor test case
1 parent 3615027 commit ccd9357

10 files changed

+1505
-2118
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"jest-environment-jsdom-global": "^2.0.4",
9797
"lint-staged": "^10.5.2",
9898
"mockjs": "^1.1.0",
99+
"node-fetch": "2",
99100
"np": "^7.0.0",
100101
"patch-package": "^6.4.7",
101102
"prettier": "^2.2.0",
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@vue/composition-api/dist/vue-composition-api.common.js b/node_modules/@vue/composition-api/dist/vue-composition-api.common.js
2+
index b791a1a..23e3c62 100644
3+
--- a/node_modules/@vue/composition-api/dist/vue-composition-api.common.js
4+
+++ b/node_modules/@vue/composition-api/dist/vue-composition-api.common.js
5+
@@ -2,7 +2,7 @@
6+
7+
Object.defineProperty(exports, '__esModule', { value: true });
8+
9+
-var Vue = require('vue');
10+
+var Vue = require('vue2');
11+
12+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13+

src/__tests__/cache.test.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
import { ref } from 'vue-demi';
2+
13
import type { CacheDataType } from '../core/utils/cache';
24
import { clearCache, getCache, setCache } from '../core/utils/cache';
35
import { waitForTime } from './utils';
46

57
describe('utils', () => {
68
const cacheKey = 'test';
79
const cacheData: CacheDataType<any, any> = {
8-
queries: {},
9-
latestQueriesKey: 'testKey',
10+
data: ref(1),
11+
error: ref(undefined),
12+
loading: ref(false),
13+
params: ref([]),
1014
};
1115
beforeAll(() => {
1216
jest.useFakeTimers();

0 commit comments

Comments
 (0)