jasmine-core 3.8.0 → 3.99.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1d57232cc4b128cad1a9e9ddbc94319bd2b56a24211eaae6e32fc1e5c181810
4
- data.tar.gz: ca6ebdb25bc946e9b2abd7e71d22e2cdf22edf33ae86824ab5e7f07d9689cdba
3
+ metadata.gz: 9c82f2cad2b9bb4ca4dd95a567ee1cf2bed5d1938247ff3dfe3c34e182c40804
4
+ data.tar.gz: e6e0f670ca4886b8fdd9aa1d88757efdfd7cba381ea1e9c99c82f5affe7f4b3b
5
5
  SHA512:
6
- metadata.gz: 0d7258d7339350d5bd68e4fa7da1b0170524f74a81c5ca1ca73f919924abde8efa98c1459bda1db2b89ca43973c821e93027ca8a0db720f67241a3aaa7b7c777
7
- data.tar.gz: 61b1a8dfdb8d06916111340bd2a281ca0da8c102385ac5e011a7091d4813f9499928060686c3b92d15d2f6aeaec642f1036fc506f6448b917470b8e601ae070e
6
+ metadata.gz: c2bac4df4afbb83a1c2a440e2eef8083e91843e92a4a4df9ee38ecd0063678b77d3428a696734deea582697e4e5111fff750d2f5bfa8edb3921037cdf5d8ffa3
7
+ data.tar.gz: 9fc060a26b269eb1acfbd2a79c507267f649ef839674b2ccd5f87af336fe4efb3e6394f8989fd17d647f04e7987f8b1628befd6191e9119d9621b3fa324e059d
@@ -1,4 +1,8 @@
1
1
  /**
2
+
3
+ NOTE: This file is deprecated and will be removed in a future release.
4
+ Include both boot0.js and boot1.js (in that order) instead.
5
+
2
6
  Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
3
7
 
4
8
  If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
@@ -55,8 +59,8 @@
55
59
  var filterSpecs = !!queryString.getParam("spec");
56
60
 
57
61
  var config = {
58
- failFast: queryString.getParam("failFast"),
59
- oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"),
62
+ stopOnSpecFailure: queryString.getParam("failFast"),
63
+ stopSpecOnExpectationFailure: queryString.getParam("oneFailurePerSpec"),
60
64
  hideDisabled: queryString.getParam("hideDisabled")
61
65
  };
62
66
 
@@ -136,4 +140,6 @@
136
140
  return destination;
137
141
  }
138
142
 
143
+ env.deprecated('boot.js is deprecated. Please use boot0.js and boot1.js instead.',
144
+ { ignoreRunnable: true });
139
145
  }());
@@ -0,0 +1,42 @@
1
+ /**
2
+ This file starts the process of "booting" Jasmine. It initializes Jasmine,
3
+ makes its globals available, and creates the env. This file should be loaded
4
+ after `jasmine.js` and `jasmine_html.js`, but before `boot1.js` or any project
5
+ source files or spec files are loaded.
6
+ */
7
+ (function() {
8
+ var jasmineRequire = window.jasmineRequire || require('./jasmine.js');
9
+
10
+ /**
11
+ * ## Require & Instantiate
12
+ *
13
+ * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
14
+ */
15
+ var jasmine = jasmineRequire.core(jasmineRequire),
16
+ global = jasmine.getGlobal();
17
+ global.jasmine = jasmine;
18
+
19
+ /**
20
+ * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
21
+ */
22
+ jasmineRequire.html(jasmine);
23
+
24
+ /**
25
+ * Create the Jasmine environment. This is used to run all specs in a project.
26
+ */
27
+ var env = jasmine.getEnv();
28
+
29
+ /**
30
+ * ## The Global Interface
31
+ *
32
+ * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
33
+ */
34
+ var jasmineInterface = jasmineRequire.interface(jasmine, env);
35
+
36
+ /**
37
+ * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
38
+ */
39
+ for (var property in jasmineInterface) {
40
+ global[property] = jasmineInterface[property];
41
+ }
42
+ }());
@@ -0,0 +1,111 @@
1
+ /**
2
+ This file finishes "booting" Jasmine, performing all of the necessary
3
+ initialization before executing the loaded environment and all of a project's
4
+ specs. This file should be loaded after `boot0.js` but before any project
5
+ source files or spec files are loaded. Thus this file can also be used to
6
+ customize Jasmine for a project.
7
+
8
+ If a project is using Jasmine via the standalone distribution, this file can
9
+ be customized directly. If you only wish to configure the Jasmine env, you
10
+ can load another file that calls `jasmine.getEnv().configure({...})`
11
+ after `boot0.js` is loaded and before this file is loaded.
12
+ */
13
+
14
+ (function() {
15
+ var env = jasmine.getEnv();
16
+
17
+ /**
18
+ * ## Runner Parameters
19
+ *
20
+ * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
21
+ */
22
+
23
+ var queryString = new jasmine.QueryString({
24
+ getWindowLocation: function() { return window.location; }
25
+ });
26
+
27
+ var filterSpecs = !!queryString.getParam("spec");
28
+
29
+ var config = {
30
+ stopOnSpecFailure: queryString.getParam("failFast"),
31
+ stopSpecOnExpectationFailure: queryString.getParam("oneFailurePerSpec"),
32
+ hideDisabled: queryString.getParam("hideDisabled")
33
+ };
34
+
35
+ var random = queryString.getParam("random");
36
+
37
+ if (random !== undefined && random !== "") {
38
+ config.random = random;
39
+ }
40
+
41
+ var seed = queryString.getParam("seed");
42
+ if (seed) {
43
+ config.seed = seed;
44
+ }
45
+
46
+ /**
47
+ * ## Reporters
48
+ * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
49
+ */
50
+ var htmlReporter = new jasmine.HtmlReporter({
51
+ env: env,
52
+ navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
53
+ addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
54
+ getContainer: function() { return document.body; },
55
+ createElement: function() { return document.createElement.apply(document, arguments); },
56
+ createTextNode: function() { return document.createTextNode.apply(document, arguments); },
57
+ timer: new jasmine.Timer(),
58
+ filterSpecs: filterSpecs
59
+ });
60
+
61
+ /**
62
+ * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
63
+ */
64
+ env.addReporter(jsApiReporter);
65
+ env.addReporter(htmlReporter);
66
+
67
+ /**
68
+ * Filter which specs will be run by matching the start of the full name against the `spec` query param.
69
+ */
70
+ var specFilter = new jasmine.HtmlSpecFilter({
71
+ filterString: function() { return queryString.getParam("spec"); }
72
+ });
73
+
74
+ config.specFilter = function(spec) {
75
+ return specFilter.matches(spec.getFullName());
76
+ };
77
+
78
+ env.configure(config);
79
+
80
+ /**
81
+ * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
82
+ */
83
+ window.setTimeout = window.setTimeout;
84
+ window.setInterval = window.setInterval;
85
+ window.clearTimeout = window.clearTimeout;
86
+ window.clearInterval = window.clearInterval;
87
+
88
+ /**
89
+ * ## Execution
90
+ *
91
+ * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
92
+ */
93
+ var currentWindowOnload = window.onload;
94
+
95
+ window.onload = function() {
96
+ if (currentWindowOnload) {
97
+ currentWindowOnload();
98
+ }
99
+ htmlReporter.initialize();
100
+ env.execute();
101
+ };
102
+
103
+ /**
104
+ * Helper function for readability above.
105
+ */
106
+ function extend(destination, source) {
107
+ for (var property in source) destination[property] = source[property];
108
+ return destination;
109
+ }
110
+
111
+ }());
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright (c) 2008-2021 Pivotal Labs
2
+ Copyright (c) 2008-2022 Pivotal Labs
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
5
5
  a copy of this software and associated documentation files (the
@@ -21,6 +21,10 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
21
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
  /**
24
+
25
+ NOTE: This file is deprecated and will be removed in a future release.
26
+ Include both boot0.js and boot1.js (in that order) instead.
27
+
24
28
  Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
25
29
 
26
30
  If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
@@ -77,8 +81,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
77
81
  var filterSpecs = !!queryString.getParam("spec");
78
82
 
79
83
  var config = {
80
- failFast: queryString.getParam("failFast"),
81
- oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"),
84
+ stopOnSpecFailure: queryString.getParam("failFast"),
85
+ stopSpecOnExpectationFailure: queryString.getParam("oneFailurePerSpec"),
82
86
  hideDisabled: queryString.getParam("hideDisabled")
83
87
  };
84
88
 
@@ -158,4 +162,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
158
162
  return destination;
159
163
  }
160
164
 
165
+ env.deprecated('boot.js is deprecated. Please use boot0.js and boot1.js instead.',
166
+ { ignoreRunnable: true });
161
167
  }());
@@ -0,0 +1,64 @@
1
+ /*
2
+ Copyright (c) 2008-2022 Pivotal Labs
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+ /**
24
+ This file starts the process of "booting" Jasmine. It initializes Jasmine,
25
+ makes its globals available, and creates the env. This file should be loaded
26
+ after `jasmine.js` and `jasmine_html.js`, but before `boot1.js` or any project
27
+ source files or spec files are loaded.
28
+ */
29
+ (function() {
30
+ var jasmineRequire = window.jasmineRequire || require('./jasmine.js');
31
+
32
+ /**
33
+ * ## Require & Instantiate
34
+ *
35
+ * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
36
+ */
37
+ var jasmine = jasmineRequire.core(jasmineRequire),
38
+ global = jasmine.getGlobal();
39
+ global.jasmine = jasmine;
40
+
41
+ /**
42
+ * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
43
+ */
44
+ jasmineRequire.html(jasmine);
45
+
46
+ /**
47
+ * Create the Jasmine environment. This is used to run all specs in a project.
48
+ */
49
+ var env = jasmine.getEnv();
50
+
51
+ /**
52
+ * ## The Global Interface
53
+ *
54
+ * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
55
+ */
56
+ var jasmineInterface = jasmineRequire.interface(jasmine, env);
57
+
58
+ /**
59
+ * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
60
+ */
61
+ for (var property in jasmineInterface) {
62
+ global[property] = jasmineInterface[property];
63
+ }
64
+ }());
@@ -0,0 +1,133 @@
1
+ /*
2
+ Copyright (c) 2008-2022 Pivotal Labs
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+ /**
24
+ This file finishes "booting" Jasmine, performing all of the necessary
25
+ initialization before executing the loaded environment and all of a project's
26
+ specs. This file should be loaded after `boot0.js` but before any project
27
+ source files or spec files are loaded. Thus this file can also be used to
28
+ customize Jasmine for a project.
29
+
30
+ If a project is using Jasmine via the standalone distribution, this file can
31
+ be customized directly. If you only wish to configure the Jasmine env, you
32
+ can load another file that calls `jasmine.getEnv().configure({...})`
33
+ after `boot0.js` is loaded and before this file is loaded.
34
+ */
35
+
36
+ (function() {
37
+ var env = jasmine.getEnv();
38
+
39
+ /**
40
+ * ## Runner Parameters
41
+ *
42
+ * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
43
+ */
44
+
45
+ var queryString = new jasmine.QueryString({
46
+ getWindowLocation: function() { return window.location; }
47
+ });
48
+
49
+ var filterSpecs = !!queryString.getParam("spec");
50
+
51
+ var config = {
52
+ stopOnSpecFailure: queryString.getParam("failFast"),
53
+ stopSpecOnExpectationFailure: queryString.getParam("oneFailurePerSpec"),
54
+ hideDisabled: queryString.getParam("hideDisabled")
55
+ };
56
+
57
+ var random = queryString.getParam("random");
58
+
59
+ if (random !== undefined && random !== "") {
60
+ config.random = random;
61
+ }
62
+
63
+ var seed = queryString.getParam("seed");
64
+ if (seed) {
65
+ config.seed = seed;
66
+ }
67
+
68
+ /**
69
+ * ## Reporters
70
+ * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
71
+ */
72
+ var htmlReporter = new jasmine.HtmlReporter({
73
+ env: env,
74
+ navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
75
+ addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
76
+ getContainer: function() { return document.body; },
77
+ createElement: function() { return document.createElement.apply(document, arguments); },
78
+ createTextNode: function() { return document.createTextNode.apply(document, arguments); },
79
+ timer: new jasmine.Timer(),
80
+ filterSpecs: filterSpecs
81
+ });
82
+
83
+ /**
84
+ * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
85
+ */
86
+ env.addReporter(jsApiReporter);
87
+ env.addReporter(htmlReporter);
88
+
89
+ /**
90
+ * Filter which specs will be run by matching the start of the full name against the `spec` query param.
91
+ */
92
+ var specFilter = new jasmine.HtmlSpecFilter({
93
+ filterString: function() { return queryString.getParam("spec"); }
94
+ });
95
+
96
+ config.specFilter = function(spec) {
97
+ return specFilter.matches(spec.getFullName());
98
+ };
99
+
100
+ env.configure(config);
101
+
102
+ /**
103
+ * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
104
+ */
105
+ window.setTimeout = window.setTimeout;
106
+ window.setInterval = window.setInterval;
107
+ window.clearTimeout = window.clearTimeout;
108
+ window.clearInterval = window.clearInterval;
109
+
110
+ /**
111
+ * ## Execution
112
+ *
113
+ * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
114
+ */
115
+ var currentWindowOnload = window.onload;
116
+
117
+ window.onload = function() {
118
+ if (currentWindowOnload) {
119
+ currentWindowOnload();
120
+ }
121
+ htmlReporter.initialize();
122
+ env.execute();
123
+ };
124
+
125
+ /**
126
+ * Helper function for readability above.
127
+ */
128
+ function extend(destination, source) {
129
+ for (var property in source) destination[property] = source[property];
130
+ return destination;
131
+ }
132
+
133
+ }());
@@ -54,9 +54,14 @@ class Core(object):
54
54
  # jasmine.js needs to be first
55
55
  js_files.insert(0, 'jasmine.js')
56
56
 
57
- # boot needs to be last
57
+ # Remove the legacy boot file
58
58
  js_files.remove('boot.js')
59
- js_files.append('boot.js')
59
+
60
+ # boot files need to be last
61
+ js_files.remove('boot0.js')
62
+ js_files.remove('boot1.js')
63
+ js_files.append('boot0.js')
64
+ js_files.append('boot1.js')
60
65
 
61
66
  return cls._uniq(js_files)
62
67
 
@@ -86,4 +91,4 @@ class Core(object):
86
91
 
87
92
  seen[marker] = 1
88
93
  result.append(item)
89
- return result
94
+ return result
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright (c) 2008-2021 Pivotal Labs
2
+ Copyright (c) 2008-2022 Pivotal Labs
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
5
5
  a copy of this software and associated documentation files (the
@@ -311,7 +311,8 @@ jasmineRequire.HtmlReporter = function(j$) {
311
311
  addDeprecationWarnings(doneResult);
312
312
 
313
313
  for (i = 0; i < deprecationWarnings.length; i++) {
314
- var context;
314
+ var children = [],
315
+ context;
315
316
 
316
317
  switch (deprecationWarnings[i].runnableType) {
317
318
  case 'spec':
@@ -324,13 +325,23 @@ jasmineRequire.HtmlReporter = function(j$) {
324
325
  context = '';
325
326
  }
326
327
 
328
+ deprecationWarnings[i].message.split('\n').forEach(function(line) {
329
+ children.push(line);
330
+ children.push(createDom('br'));
331
+ });
332
+
333
+ children[0] = 'DEPRECATION: ' + children[0];
334
+ children.push(context);
335
+
336
+ if (deprecationWarnings[i].stack) {
337
+ children.push(createExpander(deprecationWarnings[i].stack));
338
+ }
339
+
327
340
  alert.appendChild(
328
341
  createDom(
329
342
  'span',
330
343
  { className: 'jasmine-bar jasmine-warning' },
331
- 'DEPRECATION: ' + deprecationWarnings[i].message,
332
- createDom('br'),
333
- context
344
+ children
334
345
  )
335
346
  );
336
347
  }
@@ -558,17 +569,20 @@ jasmineRequire.HtmlReporter = function(j$) {
558
569
  );
559
570
 
560
571
  var failFastCheckbox = optionsMenuDom.querySelector('#jasmine-fail-fast');
561
- failFastCheckbox.checked = config.failFast;
572
+ failFastCheckbox.checked = config.stopOnSpecFailure;
562
573
  failFastCheckbox.onclick = function() {
563
- navigateWithNewParam('failFast', !config.failFast);
574
+ navigateWithNewParam('failFast', !config.stopOnSpecFailure);
564
575
  };
565
576
 
566
577
  var throwCheckbox = optionsMenuDom.querySelector(
567
578
  '#jasmine-throw-failures'
568
579
  );
569
- throwCheckbox.checked = config.oneFailurePerSpec;
580
+ throwCheckbox.checked = config.stopSpecOnExpectationFailure;
570
581
  throwCheckbox.onclick = function() {
571
- navigateWithNewParam('oneFailurePerSpec', !config.oneFailurePerSpec);
582
+ navigateWithNewParam(
583
+ 'oneFailurePerSpec',
584
+ !config.stopSpecOnExpectationFailure
585
+ );
572
586
  };
573
587
 
574
588
  var randomCheckbox = optionsMenuDom.querySelector(
@@ -649,17 +663,44 @@ jasmineRequire.HtmlReporter = function(j$) {
649
663
  if (result && result.deprecationWarnings) {
650
664
  for (var i = 0; i < result.deprecationWarnings.length; i++) {
651
665
  var warning = result.deprecationWarnings[i].message;
652
- if (!j$.util.arrayContains(warning)) {
653
- deprecationWarnings.push({
654
- message: warning,
655
- runnableName: result.fullName,
656
- runnableType: runnableType
657
- });
658
- }
666
+ deprecationWarnings.push({
667
+ message: warning,
668
+ stack: result.deprecationWarnings[i].stack,
669
+ runnableName: result.fullName,
670
+ runnableType: runnableType
671
+ });
659
672
  }
660
673
  }
661
674
  }
662
675
 
676
+ function createExpander(stackTrace) {
677
+ var expandLink = createDom('a', { href: '#' }, 'Show stack trace');
678
+ var root = createDom(
679
+ 'div',
680
+ { className: 'jasmine-expander' },
681
+ expandLink,
682
+ createDom(
683
+ 'div',
684
+ { className: 'jasmine-expander-contents jasmine-stack-trace' },
685
+ stackTrace
686
+ )
687
+ );
688
+
689
+ expandLink.addEventListener('click', function(e) {
690
+ e.preventDefault();
691
+
692
+ if (root.classList.contains('jasmine-expanded')) {
693
+ root.classList.remove('jasmine-expanded');
694
+ expandLink.textContent = 'Show stack trace';
695
+ } else {
696
+ root.classList.add('jasmine-expanded');
697
+ expandLink.textContent = 'Hide stack trace';
698
+ }
699
+ });
700
+
701
+ return root;
702
+ }
703
+
663
704
  function find(selector) {
664
705
  return getContainer().querySelector('.jasmine_html-reporter ' + selector);
665
706
  }
@@ -673,11 +714,23 @@ jasmineRequire.HtmlReporter = function(j$) {
673
714
  }
674
715
  }
675
716
 
676
- function createDom(type, attrs, childrenVarArgs) {
677
- var el = createElement(type);
717
+ function createDom(type, attrs, childrenArrayOrVarArgs) {
718
+ var el = createElement(type),
719
+ children,
720
+ i;
721
+
722
+ if (j$.isArray_(childrenArrayOrVarArgs)) {
723
+ children = childrenArrayOrVarArgs;
724
+ } else {
725
+ children = [];
726
+
727
+ for (i = 2; i < arguments.length; i++) {
728
+ children.push(arguments[i]);
729
+ }
730
+ }
678
731
 
679
- for (var i = 2; i < arguments.length; i++) {
680
- var child = arguments[i];
732
+ for (i = 0; i < children.length; i++) {
733
+ var child = children[i];
681
734
 
682
735
  if (typeof child === 'string') {
683
736
  el.appendChild(createTextNode(child));
@@ -165,6 +165,8 @@ body {
165
165
  background-color: #bababa;
166
166
  }
167
167
  .jasmine_html-reporter .jasmine-bar.jasmine-warning {
168
+ margin-top: 14px;
169
+ margin-bottom: 14px;
168
170
  background-color: #ba9d37;
169
171
  color: #333;
170
172
  }
@@ -268,4 +270,21 @@ body {
268
270
  border: 1px solid #ddd;
269
271
  background: white;
270
272
  white-space: pre;
273
+ }
274
+ .jasmine_html-reporter .jasmine-expander a {
275
+ display: block;
276
+ margin-left: 14px;
277
+ color: blue;
278
+ text-decoration: underline;
279
+ }
280
+ .jasmine_html-reporter .jasmine-expander-contents {
281
+ display: none;
282
+ }
283
+ .jasmine_html-reporter .jasmine-expanded {
284
+ padding-bottom: 10px;
285
+ }
286
+ .jasmine_html-reporter .jasmine-expanded .jasmine-expander-contents {
287
+ display: block;
288
+ margin-left: 14px;
289
+ padding: 5px;
271
290
  }