1 |
|
2 | (function () {
|
3 | var env = jasmine.getEnv();
|
4 |
|
5 | |
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | var queryString = new jasmine.QueryString({
|
12 | getWindowLocation: function () {
|
13 | return window.location;
|
14 | }
|
15 | });
|
16 |
|
17 | var specQueryParam = queryString.getParam('spec')
|
18 | var filterSpecs = !!specQueryParam;
|
19 |
|
20 | var config = {
|
21 | stopOnSpecFailure: queryString.getParam('stopOnSpecFailure'),
|
22 | stopSpecOnExpectationFailure: queryString.getParam(
|
23 | 'stopSpecOnExpectationFailure'
|
24 | ),
|
25 | hideDisabled: queryString.getParam('hideDisabled')
|
26 | };
|
27 |
|
28 | var random = queryString.getParam('random');
|
29 |
|
30 | if (random !== undefined && random !== '') {
|
31 | config.random = random;
|
32 | }
|
33 |
|
34 | var seed = queryString.getParam('seed');
|
35 | if (seed) {
|
36 | config.seed = seed;
|
37 | }
|
38 |
|
39 | |
40 |
|
41 |
|
42 |
|
43 | var htmlReporter = new jasmine.HtmlReporter({
|
44 | env: env,
|
45 | navigateWithNewParam: function (key, value) {
|
46 | return queryString.navigateWithNewParam(key, value);
|
47 | },
|
48 | addToExistingQueryString: function (key, value) {
|
49 | return queryString.fullStringWithNewParam(key, value);
|
50 | },
|
51 | getContainer: function () {
|
52 | return document.body;
|
53 | },
|
54 | createElement: function () {
|
55 | return document.createElement.apply(document, arguments);
|
56 | },
|
57 | createTextNode: function () {
|
58 | return document.createTextNode.apply(document, arguments);
|
59 | },
|
60 | timer: new jasmine.Timer(),
|
61 | filterSpecs: filterSpecs
|
62 | });
|
63 |
|
64 | |
65 |
|
66 |
|
67 | env.addReporter(jsApiReporter);
|
68 | env.addReporter(htmlReporter);
|
69 |
|
70 | |
71 |
|
72 |
|
73 |
|
74 | var specQueryParam = queryString.getParam("spec")
|
75 | if (specQueryParam) {
|
76 | var specFilter = new jasmine.HtmlSpecFilter({
|
77 | filterString: function () {
|
78 | return specQueryParam;
|
79 | }
|
80 | });
|
81 |
|
82 | config.specFilter = function (spec) {
|
83 | return specFilter.matches(spec.getFullName());
|
84 | };
|
85 | }
|
86 |
|
87 | env.configure(config);
|
88 |
|
89 | |
90 |
|
91 |
|
92 |
|
93 |
|
94 | htmlReporter.initialize();
|
95 | })();
|