forked from rantiev/template-jest-with-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.init.js
44 lines (37 loc) · 1.21 KB
/
jest.init.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
require('jest');
const _ = require('lodash');
require('angular');
require('angular-ui-router');
require('angular-mocks');
require('modules/subApp.module.js');
require('app.js');
require('app.config.js');
require('app.run.js');
require('app.bootstrap.js');
require('constants/mockData.constant.js');
require('services/helper.service.js');
require('controllers/main.controller.js');
require('controllers/additional.controller.js');
require('controllers/home.controller.js');
require('controllers/page1.controller.js');
require('controllers/page2.controller.js');
require('components/myHeader/myHeader.directive.js');
require('components/myFooter/myFooter.component.js');
Object.defineProperty(window, '_', {
value: _,
});
/*
const mock = () => {
let storage = {};
return {
getItem: key => key in storage ? storage[key] : null,
setItem: (key, value) => storage[key] = value || '',
removeItem: key => delete storage[key],
clear: () => storage = {},
};
};
Object.defineProperty(window, 'localStorage', {value: mock()});
Object.defineProperty(window, 'sessionStorage', {value: mock()});
Object.defineProperty(window, 'getComputedStyle', {
value: () => ['-webkit-appearance']
});*/