-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
52 lines (43 loc) · 1.01 KB
/
index.js
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
'use strict';
var each = require('lodash/forEach'),
noop = require('lodash/noop');
function EventSource() {}
EventSource.prototype.addEventListener = noop;
function jQuery() {
return {
'on': function(eventName, callback) {
callback();
}
};
}
jQuery.each = each;
module.exports = {
// Example mocks.
'addContactToList': noop,
'asyncSave': noop,
'batchLog': noop,
'calculateLayout': noop,
'createApplication': noop,
'data': { 'user': 'mock' },
'mainText': '',
'renewToken': noop,
'sendMail': noop,
'updatePosition': noop,
// DOM mocks.
'document': { 'body': { 'childNodes': [], 'nodeName': 'BODY' } },
'element': {},
'EventSource': EventSource,
'jQuery': jQuery,
'window': {},
// Node.js mocks.
'Buffer': Buffer,
'fs': { 'writeFileSync': noop },
'path': require('path'),
'process': process,
'setImmediate': setImmediate,
// Lodash v3.10.1 mocks.
'cwd': '',
'mage': { 'castSpell': noop },
'models': { 'todo': {} },
'throttled': { 'cancel': noop }
};