forked from spinnaker/deck
-
Notifications
You must be signed in to change notification settings - Fork 2
/
karma-shim.js
68 lines (47 loc) · 2.51 KB
/
karma-shim.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* eslint-disable @spinnaker/import-sort */
import jQuery from 'jquery';
// jquery has to be first or many a test will break
global.$ = global.jQuery = jQuery;
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
Error.stackTraceLimit = Infinity;
import './packages/app/src/settings';
import './packages/app/src/app';
import { jasmineMockHttpSupport } from './packages/core/src/api/mock/jasmine';
// angular 1 test harness
import 'angular';
import 'angular-mocks';
beforeEach(angular.mock.module('bcherny/ngimport'));
jasmineMockHttpSupport();
let testContext;
testContext = require.context('./packages/amazon/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/appengine/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/azure/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/cloudfoundry/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/cloudrun/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/core/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/dcos/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/docker/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/ecs/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/google/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/huaweicloud/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/kubernetes/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/oracle/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/tencentcloud/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);
testContext = require.context('./packages/titus/src', true, /\.spec\.(js|ts|tsx)$/);
testContext.keys().forEach(testContext);