-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathjest-globals.js
More file actions
74 lines (72 loc) · 1.83 KB
/
jest-globals.js
File metadata and controls
74 lines (72 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function notImplemented() {
throw Error(`Not Implemented`);
}
// @todo expect.extend() et al
global.jest = {
addMatchers(matchers) {
jasmine.addMatchers(matchers);
},
advanceTimersByTime(msToRun) {
// _getFakeTimers().advanceTimersByTime(msToRun);
notImplemented();
},
advanceTimersToNextTimer(steps) {
// _getFakeTimers().advanceTimersToNextTimer(steps);
notImplemented();
},
autoMockOff: notImplemented,
autoMockOn: notImplemented,
clearAllMocks: notImplemented,
clearAllTimers() {
// _getFakeTimers().clearAllTimers();
notImplemented();
},
createMockFromModule(moduleName) {
// return this._generateMock(from, moduleName);
notImplemented();
},
deepUnmock: notImplemented,
disableAutomock: notImplemented,
doMock: notImplemented,
dontMock: notImplemented,
enableAutomock: notImplemented,
fn: jasmine.createSpy,
genMockFromModule(moduleName) {
// return this._generateMock(from, moduleName);
notImplemented();
},
getRealSystemTime: notImplemented,
getTimerCount() {
// return _getFakeTimers().getTimerCount();
notImplemented();
},
isMockFunction(fn) {
// check if spy/mock
notImplemented();
},
isolateModules: notImplemented,
mock: jasmine.createSpy, // @todo check
requireActual: require,
requireMock: notImplemented,
resetAllMocks: notImplemented,
resetModuleRegistry: notImplemented,
resetModules: notImplemented,
restoreAllMocks: notImplemented,
retryTimes: notImplemented,
runAllImmediates() {
notImplemented();
},
runAllTicks: notImplemented,
runAllTimers: notImplemented,
runOnlyPendingTimers: notImplemented,
runTimersToTime: notImplemented,
setMock: notImplemented,
setSystemTime(now) {
notImplemented();
},
setTimeout,
spyOn: jasmine.createSpy, // @todo check
unmock: (mock) => mock.restore(), // @todo check
useFakeTimers: notImplemented,
useRealTimers: notImplemented,
};