jasmine-core 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jasmine-core/boot.js +6 -6
- data/lib/jasmine-core/boot/boot.js +6 -6
- data/lib/jasmine-core/example/spec/SpecHelper.js +1 -1
- data/lib/jasmine-core/jasmine-html.js +43 -13
- data/lib/jasmine-core/jasmine.css +6 -3
- data/lib/jasmine-core/jasmine.js +399 -149
- data/lib/jasmine-core/spec/core/ClockSpec.js +214 -22
- data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +0 -41
- data/lib/jasmine-core/spec/core/EnvSpec.js +20 -0
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +57 -27
- data/lib/jasmine-core/spec/core/SpecSpec.js +140 -1
- data/lib/jasmine-core/spec/core/SuiteSpec.js +47 -244
- data/lib/jasmine-core/spec/core/TreeProcessorSpec.js +633 -0
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js +2 -3
- data/lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js +31 -0
- data/lib/jasmine-core/spec/core/integration/EnvSpec.js +35 -6
- data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +108 -15
- data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +27 -0
- data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +0 -2
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +115 -1
- data/lib/jasmine-core/spec/npmPackage/npmPackageSpec.js +2 -5
- data/lib/jasmine-core/version.rb +1 -1
- metadata +96 -95
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98176a36588bb9db3608725662a81381a2e30c94
|
4
|
+
data.tar.gz: 549b65f83c96c7a08bdfd73cfad35520a48bce5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1feb4daf3115deb475db3b8721a3c7f041ef3b68b955148f31d02d6684b810b3ae5a31c2234dde15cc1895e3ea6e3cb02d72ba1c1c0d579429d7768b92e4dcf
|
7
|
+
data.tar.gz: 1fbe5447fbd1c40bf0be919d4196b640d4c4df6469340f3840ad34989f6b7e9f7880f63bee407200568566145a5492b6bf8e4714ccfca420bb564e1b05f7f5f7
|
data/lib/jasmine-core/boot.js
CHANGED
@@ -57,13 +57,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
57
57
|
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
58
58
|
|
59
59
|
/**
|
60
|
-
* Add all of the Jasmine global/public interface to the
|
60
|
+
* 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`.
|
61
61
|
*/
|
62
|
-
|
63
|
-
extend(exports, jasmineInterface);
|
64
|
-
} else {
|
65
|
-
extend(window, jasmineInterface);
|
66
|
-
}
|
62
|
+
extend(window, jasmineInterface);
|
67
63
|
|
68
64
|
/**
|
69
65
|
* ## Runner Parameters
|
@@ -78,6 +74,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
78
74
|
var catchingExceptions = queryString.getParam("catch");
|
79
75
|
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
|
80
76
|
|
77
|
+
var throwingExpectationFailures = queryString.getParam("throwFailures");
|
78
|
+
env.throwOnExpectationFailure(throwingExpectationFailures);
|
79
|
+
|
81
80
|
/**
|
82
81
|
* ## Reporters
|
83
82
|
* 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).
|
@@ -85,6 +84,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
85
84
|
var htmlReporter = new jasmine.HtmlReporter({
|
86
85
|
env: env,
|
87
86
|
onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); },
|
87
|
+
onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); },
|
88
88
|
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
|
89
89
|
getContainer: function() { return document.body; },
|
90
90
|
createElement: function() { return document.createElement.apply(document, arguments); },
|
@@ -35,13 +35,9 @@
|
|
35
35
|
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
36
36
|
|
37
37
|
/**
|
38
|
-
* Add all of the Jasmine global/public interface to the
|
38
|
+
* 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`.
|
39
39
|
*/
|
40
|
-
|
41
|
-
extend(exports, jasmineInterface);
|
42
|
-
} else {
|
43
|
-
extend(window, jasmineInterface);
|
44
|
-
}
|
40
|
+
extend(window, jasmineInterface);
|
45
41
|
|
46
42
|
/**
|
47
43
|
* ## Runner Parameters
|
@@ -56,6 +52,9 @@
|
|
56
52
|
var catchingExceptions = queryString.getParam("catch");
|
57
53
|
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
|
58
54
|
|
55
|
+
var throwingExpectationFailures = queryString.getParam("throwFailures");
|
56
|
+
env.throwOnExpectationFailure(throwingExpectationFailures);
|
57
|
+
|
59
58
|
/**
|
60
59
|
* ## Reporters
|
61
60
|
* 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).
|
@@ -63,6 +62,7 @@
|
|
63
62
|
var htmlReporter = new jasmine.HtmlReporter({
|
64
63
|
env: env,
|
65
64
|
onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); },
|
65
|
+
onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); },
|
66
66
|
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
|
67
67
|
getContainer: function() { return document.body; },
|
68
68
|
createElement: function() { return document.createElement.apply(document, arguments); },
|
@@ -40,6 +40,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
|
40
40
|
createElement = options.createElement,
|
41
41
|
createTextNode = options.createTextNode,
|
42
42
|
onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {},
|
43
|
+
onThrowExpectationsClick = options.onThrowExpectationsClick || function() {},
|
43
44
|
addToExistingQueryString = options.addToExistingQueryString || defaultQueryString,
|
44
45
|
timer = options.timer || noopTimer,
|
45
46
|
results = [],
|
@@ -145,22 +146,51 @@ jasmineRequire.HtmlReporter = function(j$) {
|
|
145
146
|
|
146
147
|
this.jasmineDone = function() {
|
147
148
|
var banner = find('.banner');
|
148
|
-
banner.appendChild(createDom('span', {className: 'duration'}, 'finished in ' + timer.elapsed() / 1000 + 's'));
|
149
|
-
|
150
149
|
var alert = find('.alert');
|
150
|
+
alert.appendChild(createDom('span', {className: 'duration'}, 'finished in ' + timer.elapsed() / 1000 + 's'));
|
151
|
+
|
152
|
+
banner.appendChild(
|
153
|
+
createDom('div', { className: 'run-options' },
|
154
|
+
createDom('span', { className: 'trigger' }, 'Options'),
|
155
|
+
createDom('div', { className: 'payload' },
|
156
|
+
createDom('div', { className: 'exceptions' },
|
157
|
+
createDom('input', {
|
158
|
+
className: 'raise',
|
159
|
+
id: 'raise-exceptions',
|
160
|
+
type: 'checkbox'
|
161
|
+
}),
|
162
|
+
createDom('label', { className: 'label', 'for': 'raise-exceptions' }, 'raise exceptions')),
|
163
|
+
createDom('div', { className: 'throw-failures' },
|
164
|
+
createDom('input', {
|
165
|
+
className: 'throw',
|
166
|
+
id: 'throw-failures',
|
167
|
+
type: 'checkbox'
|
168
|
+
}),
|
169
|
+
createDom('label', { className: 'label', 'for': 'throw-failures' }, 'stop spec on expectation failure'))
|
170
|
+
)
|
171
|
+
));
|
151
172
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
id: 'raise-exceptions',
|
157
|
-
type: 'checkbox'
|
158
|
-
})
|
159
|
-
));
|
160
|
-
var checkbox = find('#raise-exceptions');
|
173
|
+
var raiseCheckbox = find('#raise-exceptions');
|
174
|
+
|
175
|
+
raiseCheckbox.checked = !env.catchingExceptions();
|
176
|
+
raiseCheckbox.onclick = onRaiseExceptionsClick;
|
161
177
|
|
162
|
-
|
163
|
-
|
178
|
+
var throwCheckbox = find('#throw-failures');
|
179
|
+
throwCheckbox.checked = env.throwingExpectationFailures();
|
180
|
+
throwCheckbox.onclick = onThrowExpectationsClick;
|
181
|
+
|
182
|
+
var optionsMenu = find('.run-options'),
|
183
|
+
optionsTrigger = optionsMenu.querySelector('.trigger'),
|
184
|
+
optionsPayload = optionsMenu.querySelector('.payload'),
|
185
|
+
isOpen = /\bopen\b/;
|
186
|
+
|
187
|
+
optionsTrigger.onclick = function() {
|
188
|
+
if (isOpen.test(optionsPayload.className)) {
|
189
|
+
optionsPayload.className = optionsPayload.className.replace(isOpen, '');
|
190
|
+
} else {
|
191
|
+
optionsPayload.className += ' open';
|
192
|
+
}
|
193
|
+
};
|
164
194
|
|
165
195
|
if (specsExecuted < totalSpecsDefined) {
|
166
196
|
var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all';
|
@@ -8,11 +8,10 @@ body { overflow-y: scroll; }
|
|
8
8
|
.jasmine_html-reporter .banner { position: relative; }
|
9
9
|
.jasmine_html-reporter .banner .title { background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAAAZCAMAAACGusnyAAACdlBMVEX/////AP+AgICqVaqAQICZM5mAVYCSSZKAQICOOY6ATYCLRouAQICJO4mSSYCIRIiPQICHPIeOR4CGQ4aMQICGPYaLRoCFQ4WKQICPPYWJRYCOQoSJQICNPoSIRICMQoSHQICHRICKQoOHQICKPoOJO4OJQYOMQICMQ4CIQYKLQICIPoKLQ4CKQICNPoKJQISMQ4KJQoSLQYKJQISL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gNjA3LjQ2NSw5MDMuNDQ1IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNTIiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjxwYXRoCiAgICAgICAgICAgICBkPSJtIDM4MC42ODgsNjIyLjEyOSAtMTEuNjI2LDM1LjgwMSAxNzUuNzU4LDU3LjA5IDExLjYyMSwtMzUuODAxIC0xNzUuNzUzLC01Ny4wOSIKICAgICAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgICAgICBpZD0icGF0aDU0IgogICAgICAgICAgICAgc3R5bGU9ImZpbGw6IzhhNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSA3MTYuMjg5LDM3Ni41OSAzNy42NDA2LDAgMCwxODQuODE2IC0zNy42NDA2LDAgMCwtMTg0LjgxNiB6IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNTYiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=') no-repeat, none; -moz-background-size: 100%; -o-background-size: 100%; -webkit-background-size: 100%; background-size: 100%; display: block; float: left; width: 90px; height: 25px; }
|
10
10
|
.jasmine_html-reporter .banner .version { margin-left: 14px; position: relative; top: 6px; }
|
11
|
-
.jasmine_html-reporter .banner .duration { position: absolute; right: 14px; top: 6px; }
|
12
11
|
.jasmine_html-reporter #jasmine_content { position: fixed; right: 100%; }
|
13
12
|
.jasmine_html-reporter .version { color: #aaa; }
|
14
13
|
.jasmine_html-reporter .banner { margin-top: 14px; }
|
15
|
-
.jasmine_html-reporter .duration { color: #
|
14
|
+
.jasmine_html-reporter .duration { color: #fff; float: right; line-height: 28px; padding-right: 9px; }
|
16
15
|
.jasmine_html-reporter .symbol-summary { overflow: hidden; *zoom: 1; margin: 14px 0; }
|
17
16
|
.jasmine_html-reporter .symbol-summary li { display: inline-block; height: 8px; width: 14px; font-size: 16px; }
|
18
17
|
.jasmine_html-reporter .symbol-summary li.passed { font-size: 14px; }
|
@@ -25,7 +24,10 @@ body { overflow-y: scroll; }
|
|
25
24
|
.jasmine_html-reporter .symbol-summary li.pending:before { color: #ba9d37; content: "*"; }
|
26
25
|
.jasmine_html-reporter .symbol-summary li.empty { font-size: 14px; }
|
27
26
|
.jasmine_html-reporter .symbol-summary li.empty:before { color: #ba9d37; content: "\02022"; }
|
28
|
-
.jasmine_html-reporter .
|
27
|
+
.jasmine_html-reporter .run-options { float: right; margin-right: 5px; border: 1px solid #8a4182; color: #8a4182; position: relative; line-height: 20px; }
|
28
|
+
.jasmine_html-reporter .run-options .trigger { cursor: pointer; padding: 8px 16px; }
|
29
|
+
.jasmine_html-reporter .run-options .payload { position: absolute; display: none; right: -1px; border: 1px solid #8a4182; background-color: #eee; white-space: nowrap; padding: 4px 8px; }
|
30
|
+
.jasmine_html-reporter .run-options .payload.open { display: block; }
|
29
31
|
.jasmine_html-reporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
|
30
32
|
.jasmine_html-reporter .bar.failed { background-color: #ca3a11; }
|
31
33
|
.jasmine_html-reporter .bar.passed { background-color: #007069; }
|
@@ -51,6 +53,7 @@ body { overflow-y: scroll; }
|
|
51
53
|
.jasmine_html-reporter .summary li.failed a { color: #ca3a11; }
|
52
54
|
.jasmine_html-reporter .summary li.empty a { color: #ba9d37; }
|
53
55
|
.jasmine_html-reporter .summary li.pending a { color: #ba9d37; }
|
56
|
+
.jasmine_html-reporter .summary li.disabled a { color: #bababa; }
|
54
57
|
.jasmine_html-reporter .description + .suite { margin-top: 0; }
|
55
58
|
.jasmine_html-reporter .suite { margin-top: 14px; }
|
56
59
|
.jasmine_html-reporter .suite a { color: #333; }
|
data/lib/jasmine-core/jasmine.js
CHANGED
@@ -42,7 +42,8 @@ var getJasmineRequireObj = (function (jasmineGlobal) {
|
|
42
42
|
|
43
43
|
jRequire.base(j$, jasmineGlobal);
|
44
44
|
j$.util = jRequire.util();
|
45
|
-
j$.
|
45
|
+
j$.errors = jRequire.errors();
|
46
|
+
j$.Any = jRequire.Any(j$);
|
46
47
|
j$.Anything = jRequire.Anything(j$);
|
47
48
|
j$.CallTracker = jRequire.CallTracker();
|
48
49
|
j$.MockDate = jRequire.MockDate();
|
@@ -63,8 +64,9 @@ var getJasmineRequireObj = (function (jasmineGlobal) {
|
|
63
64
|
j$.SpyRegistry = jRequire.SpyRegistry(j$);
|
64
65
|
j$.SpyStrategy = jRequire.SpyStrategy();
|
65
66
|
j$.StringMatching = jRequire.StringMatching(j$);
|
66
|
-
j$.Suite = jRequire.Suite();
|
67
|
+
j$.Suite = jRequire.Suite(j$);
|
67
68
|
j$.Timer = jRequire.Timer();
|
69
|
+
j$.TreeProcessor = jRequire.TreeProcessor();
|
68
70
|
j$.version = jRequire.version();
|
69
71
|
|
70
72
|
j$.matchers = jRequire.requireMatchers(jRequire, j$);
|
@@ -302,6 +304,7 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
302
304
|
this.expectationResultFactory = attrs.expectationResultFactory || function() { };
|
303
305
|
this.queueRunnerFactory = attrs.queueRunnerFactory || function() {};
|
304
306
|
this.catchingExceptions = attrs.catchingExceptions || function() { return true; };
|
307
|
+
this.throwOnExpectationFailure = !!attrs.throwOnExpectationFailure;
|
305
308
|
|
306
309
|
if (!this.queueableFn.fn) {
|
307
310
|
this.pend();
|
@@ -317,12 +320,16 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
317
320
|
};
|
318
321
|
}
|
319
322
|
|
320
|
-
Spec.prototype.addExpectationResult = function(passed, data) {
|
323
|
+
Spec.prototype.addExpectationResult = function(passed, data, isError) {
|
321
324
|
var expectationResult = this.expectationResultFactory(data);
|
322
325
|
if (passed) {
|
323
326
|
this.result.passedExpectations.push(expectationResult);
|
324
327
|
} else {
|
325
328
|
this.result.failedExpectations.push(expectationResult);
|
329
|
+
|
330
|
+
if (this.throwOnExpectationFailure && !isError) {
|
331
|
+
throw new j$.errors.ExpectationFailed();
|
332
|
+
}
|
326
333
|
}
|
327
334
|
};
|
328
335
|
|
@@ -330,13 +337,13 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
330
337
|
return this.expectationFactory(actual, this);
|
331
338
|
};
|
332
339
|
|
333
|
-
Spec.prototype.execute = function(onComplete) {
|
340
|
+
Spec.prototype.execute = function(onComplete, enabled) {
|
334
341
|
var self = this;
|
335
342
|
|
336
343
|
this.onStart(this);
|
337
344
|
|
338
|
-
if (this.
|
339
|
-
complete();
|
345
|
+
if (!this.isExecutable() || enabled === false) {
|
346
|
+
complete(enabled);
|
340
347
|
return;
|
341
348
|
}
|
342
349
|
|
@@ -350,8 +357,8 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
350
357
|
userContext: this.userContext()
|
351
358
|
});
|
352
359
|
|
353
|
-
function complete() {
|
354
|
-
self.result.status = self.status();
|
360
|
+
function complete(enabledAgain) {
|
361
|
+
self.result.status = self.status(enabledAgain);
|
355
362
|
self.resultCallback(self.result);
|
356
363
|
|
357
364
|
if (onComplete) {
|
@@ -366,13 +373,17 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
366
373
|
return;
|
367
374
|
}
|
368
375
|
|
376
|
+
if (e instanceof j$.errors.ExpectationFailed) {
|
377
|
+
return;
|
378
|
+
}
|
379
|
+
|
369
380
|
this.addExpectationResult(false, {
|
370
381
|
matcherName: '',
|
371
382
|
passed: false,
|
372
383
|
expected: '',
|
373
384
|
actual: '',
|
374
385
|
error: e
|
375
|
-
});
|
386
|
+
}, true);
|
376
387
|
};
|
377
388
|
|
378
389
|
Spec.prototype.disable = function() {
|
@@ -386,8 +397,13 @@ getJasmineRequireObj().Spec = function(j$) {
|
|
386
397
|
}
|
387
398
|
};
|
388
399
|
|
389
|
-
Spec.prototype.
|
390
|
-
|
400
|
+
Spec.prototype.getResult = function() {
|
401
|
+
this.result.status = this.status();
|
402
|
+
return this.result;
|
403
|
+
};
|
404
|
+
|
405
|
+
Spec.prototype.status = function(enabled) {
|
406
|
+
if (this.disabled || enabled === false) {
|
391
407
|
return 'disabled';
|
392
408
|
}
|
393
409
|
|
@@ -444,7 +460,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|
444
460
|
|
445
461
|
var realSetTimeout = j$.getGlobal().setTimeout;
|
446
462
|
var realClearTimeout = j$.getGlobal().clearTimeout;
|
447
|
-
this.clock = new j$.Clock(global, new j$.DelayedFunctionScheduler(), new j$.MockDate(global));
|
463
|
+
this.clock = new j$.Clock(global, function () { return new j$.DelayedFunctionScheduler(); }, new j$.MockDate(global));
|
448
464
|
|
449
465
|
var runnableLookupTable = {};
|
450
466
|
var runnableResources = {};
|
@@ -452,6 +468,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|
452
468
|
var currentSpec = null;
|
453
469
|
var currentlyExecutingSuites = [];
|
454
470
|
var currentDeclarationSuite = null;
|
471
|
+
var throwOnExpectationFailure = false;
|
455
472
|
|
456
473
|
var currentSuite = function() {
|
457
474
|
return currentlyExecutingSuites[currentlyExecutingSuites.length - 1];
|
@@ -533,27 +550,21 @@ getJasmineRequireObj().Env = function(j$) {
|
|
533
550
|
delete runnableResources[id];
|
534
551
|
};
|
535
552
|
|
536
|
-
var beforeAndAfterFns = function(suite
|
553
|
+
var beforeAndAfterFns = function(suite) {
|
537
554
|
return function() {
|
538
555
|
var befores = [],
|
539
|
-
afters = []
|
540
|
-
beforeAlls = [],
|
541
|
-
afterAlls = [];
|
556
|
+
afters = [];
|
542
557
|
|
543
558
|
while(suite) {
|
544
559
|
befores = befores.concat(suite.beforeFns);
|
545
560
|
afters = afters.concat(suite.afterFns);
|
546
561
|
|
547
|
-
if (runnablesExplictlySet()) {
|
548
|
-
beforeAlls = beforeAlls.concat(suite.beforeAllFns);
|
549
|
-
afterAlls = afterAlls.concat(suite.afterAllFns);
|
550
|
-
}
|
551
|
-
|
552
562
|
suite = suite.parentSuite;
|
553
563
|
}
|
564
|
+
|
554
565
|
return {
|
555
|
-
befores:
|
556
|
-
afters: afters
|
566
|
+
befores: befores.reverse(),
|
567
|
+
afters: afters
|
557
568
|
};
|
558
569
|
};
|
559
570
|
};
|
@@ -599,10 +610,18 @@ getJasmineRequireObj().Env = function(j$) {
|
|
599
610
|
return j$.Spec.isPendingSpecException(e) || catchExceptions;
|
600
611
|
};
|
601
612
|
|
613
|
+
this.throwOnExpectationFailure = function(value) {
|
614
|
+
throwOnExpectationFailure = !!value;
|
615
|
+
};
|
616
|
+
|
617
|
+
this.throwingExpectationFailures = function() {
|
618
|
+
return throwOnExpectationFailure;
|
619
|
+
};
|
620
|
+
|
602
621
|
var queueRunnerFactory = function(options) {
|
603
622
|
options.catchException = catchException;
|
604
623
|
options.clearStack = options.clearStack || clearStack;
|
605
|
-
options.
|
624
|
+
options.timeout = {setTimeout: realSetTimeout, clearTimeout: realClearTimeout};
|
606
625
|
options.fail = self.fail;
|
607
626
|
|
608
627
|
new j$.QueueRunner(options).execute();
|
@@ -623,26 +642,40 @@ getJasmineRequireObj().Env = function(j$) {
|
|
623
642
|
};
|
624
643
|
|
625
644
|
this.execute = function(runnablesToRun) {
|
626
|
-
if(runnablesToRun) {
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
runnablesToRun = [topSuite.id];
|
645
|
+
if(!runnablesToRun) {
|
646
|
+
if (focusedRunnables.length) {
|
647
|
+
runnablesToRun = focusedRunnables;
|
648
|
+
} else {
|
649
|
+
runnablesToRun = [topSuite.id];
|
650
|
+
}
|
633
651
|
}
|
652
|
+
var processor = new j$.TreeProcessor({
|
653
|
+
tree: topSuite,
|
654
|
+
runnableIds: runnablesToRun,
|
655
|
+
queueRunnerFactory: queueRunnerFactory,
|
656
|
+
nodeStart: function(suite) {
|
657
|
+
currentlyExecutingSuites.push(suite);
|
658
|
+
defaultResourcesForRunnable(suite.id, suite.parentSuite.id);
|
659
|
+
reporter.suiteStarted(suite.result);
|
660
|
+
},
|
661
|
+
nodeComplete: function(suite, result) {
|
662
|
+
if (!suite.disabled) {
|
663
|
+
clearResourcesForRunnable(suite.id);
|
664
|
+
}
|
665
|
+
currentlyExecutingSuites.pop();
|
666
|
+
reporter.suiteDone(result);
|
667
|
+
}
|
668
|
+
});
|
634
669
|
|
635
|
-
|
636
|
-
|
637
|
-
var runnable = runnableLookupTable[runnablesToRun[i]];
|
638
|
-
allFns.push((function(runnable) { return { fn: function(done) { runnable.execute(done); } }; })(runnable));
|
670
|
+
if(!processor.processTree().valid) {
|
671
|
+
throw new Error('Invalid order: would cause a beforeAll or afterAll to be run multiple times');
|
639
672
|
}
|
640
673
|
|
641
674
|
reporter.jasmineStarted({
|
642
675
|
totalSpecsDefined: totalSpecsDefined
|
643
676
|
});
|
644
677
|
|
645
|
-
|
678
|
+
processor.execute(reporter.jasmineDone);
|
646
679
|
};
|
647
680
|
|
648
681
|
this.addReporter = function(reporterToAdd) {
|
@@ -666,28 +699,13 @@ getJasmineRequireObj().Env = function(j$) {
|
|
666
699
|
id: getNextSuiteId(),
|
667
700
|
description: description,
|
668
701
|
parentSuite: currentDeclarationSuite,
|
669
|
-
queueRunner: queueRunnerFactory,
|
670
|
-
onStart: suiteStarted,
|
671
702
|
expectationFactory: expectationFactory,
|
672
703
|
expectationResultFactory: expectationResultFactory,
|
673
|
-
|
674
|
-
resultCallback: function(attrs) {
|
675
|
-
if (!suite.disabled) {
|
676
|
-
clearResourcesForRunnable(suite.id);
|
677
|
-
}
|
678
|
-
currentlyExecutingSuites.pop();
|
679
|
-
reporter.suiteDone(attrs);
|
680
|
-
}
|
704
|
+
throwOnExpectationFailure: throwOnExpectationFailure
|
681
705
|
});
|
682
706
|
|
683
707
|
runnableLookupTable[suite.id] = suite;
|
684
708
|
return suite;
|
685
|
-
|
686
|
-
function suiteStarted(suite) {
|
687
|
-
currentlyExecutingSuites.push(suite);
|
688
|
-
defaultResourcesForRunnable(suite.id, suite.parentSuite.id);
|
689
|
-
reporter.suiteStarted(suite.result);
|
690
|
-
}
|
691
709
|
};
|
692
710
|
|
693
711
|
this.describe = function(description, specDefinitions) {
|
@@ -759,17 +777,11 @@ getJasmineRequireObj().Env = function(j$) {
|
|
759
777
|
}
|
760
778
|
}
|
761
779
|
|
762
|
-
var runnablesExplictlySet = false;
|
763
|
-
|
764
|
-
var runnablesExplictlySetGetter = function(){
|
765
|
-
return runnablesExplictlySet;
|
766
|
-
};
|
767
|
-
|
768
780
|
var specFactory = function(description, fn, suite, timeout) {
|
769
781
|
totalSpecsDefined++;
|
770
782
|
var spec = new j$.Spec({
|
771
783
|
id: getNextSpecId(),
|
772
|
-
beforeAndAfterFns: beforeAndAfterFns(suite
|
784
|
+
beforeAndAfterFns: beforeAndAfterFns(suite),
|
773
785
|
expectationFactory: expectationFactory,
|
774
786
|
resultCallback: specResultCallback,
|
775
787
|
getSpecName: function(spec) {
|
@@ -783,7 +795,8 @@ getJasmineRequireObj().Env = function(j$) {
|
|
783
795
|
queueableFn: {
|
784
796
|
fn: fn,
|
785
797
|
timeout: function() { return timeout || j$.DEFAULT_TIMEOUT_INTERVAL; }
|
786
|
-
}
|
798
|
+
},
|
799
|
+
throwOnExpectationFailure: throwOnExpectationFailure
|
787
800
|
});
|
788
801
|
|
789
802
|
runnableLookupTable[spec.id] = spec;
|
@@ -1023,7 +1036,7 @@ getJasmineRequireObj().CallTracker = function() {
|
|
1023
1036
|
};
|
1024
1037
|
|
1025
1038
|
getJasmineRequireObj().Clock = function() {
|
1026
|
-
function Clock(global,
|
1039
|
+
function Clock(global, delayedFunctionSchedulerFactory, mockDate) {
|
1027
1040
|
var self = this,
|
1028
1041
|
realTimingFunctions = {
|
1029
1042
|
setTimeout: global.setTimeout,
|
@@ -1038,19 +1051,24 @@ getJasmineRequireObj().Clock = function() {
|
|
1038
1051
|
clearInterval: clearInterval
|
1039
1052
|
},
|
1040
1053
|
installed = false,
|
1054
|
+
delayedFunctionScheduler,
|
1041
1055
|
timer;
|
1042
1056
|
|
1043
1057
|
|
1044
1058
|
self.install = function() {
|
1059
|
+
if(!originalTimingFunctionsIntact()) {
|
1060
|
+
throw new Error('Jasmine Clock was unable to install over custom global timer functions. Is the clock already installed?');
|
1061
|
+
}
|
1045
1062
|
replace(global, fakeTimingFunctions);
|
1046
1063
|
timer = fakeTimingFunctions;
|
1064
|
+
delayedFunctionScheduler = delayedFunctionSchedulerFactory();
|
1047
1065
|
installed = true;
|
1048
1066
|
|
1049
1067
|
return self;
|
1050
1068
|
};
|
1051
1069
|
|
1052
1070
|
self.uninstall = function() {
|
1053
|
-
delayedFunctionScheduler
|
1071
|
+
delayedFunctionScheduler = null;
|
1054
1072
|
mockDate.uninstall();
|
1055
1073
|
replace(global, realTimingFunctions);
|
1056
1074
|
|
@@ -1058,6 +1076,15 @@ getJasmineRequireObj().Clock = function() {
|
|
1058
1076
|
installed = false;
|
1059
1077
|
};
|
1060
1078
|
|
1079
|
+
self.withMock = function(closure) {
|
1080
|
+
this.install();
|
1081
|
+
try {
|
1082
|
+
closure();
|
1083
|
+
} finally {
|
1084
|
+
this.uninstall();
|
1085
|
+
}
|
1086
|
+
};
|
1087
|
+
|
1061
1088
|
self.mockDate = function(initialDate) {
|
1062
1089
|
mockDate.install(initialDate);
|
1063
1090
|
};
|
@@ -1101,6 +1128,13 @@ getJasmineRequireObj().Clock = function() {
|
|
1101
1128
|
|
1102
1129
|
return self;
|
1103
1130
|
|
1131
|
+
function originalTimingFunctionsIntact() {
|
1132
|
+
return global.setTimeout === realTimingFunctions.setTimeout &&
|
1133
|
+
global.clearTimeout === realTimingFunctions.clearTimeout &&
|
1134
|
+
global.setInterval === realTimingFunctions.setInterval &&
|
1135
|
+
global.clearInterval === realTimingFunctions.clearInterval;
|
1136
|
+
}
|
1137
|
+
|
1104
1138
|
function legacyIE() {
|
1105
1139
|
//if these methods are polyfilled, apply will be present
|
1106
1140
|
return !(realTimingFunctions.setTimeout || realTimingFunctions.setInterval).apply;
|
@@ -1210,13 +1244,6 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
|
|
1210
1244
|
}
|
1211
1245
|
};
|
1212
1246
|
|
1213
|
-
self.reset = function() {
|
1214
|
-
currentTime = 0;
|
1215
|
-
scheduledLookup = [];
|
1216
|
-
scheduledFunctions = {};
|
1217
|
-
delayedFnCount = 0;
|
1218
|
-
};
|
1219
|
-
|
1220
1247
|
return self;
|
1221
1248
|
|
1222
1249
|
function indexOfFirstToPass(array, testFn) {
|
@@ -1642,6 +1669,23 @@ getJasmineRequireObj().pp = function(j$) {
|
|
1642
1669
|
if(array.length > length){
|
1643
1670
|
this.append(', ...');
|
1644
1671
|
}
|
1672
|
+
|
1673
|
+
var self = this;
|
1674
|
+
var first = array.length === 0;
|
1675
|
+
this.iterateObject(array, function(property, isGetter) {
|
1676
|
+
if (property.match(/^\d+$/)) {
|
1677
|
+
return;
|
1678
|
+
}
|
1679
|
+
|
1680
|
+
if (first) {
|
1681
|
+
first = false;
|
1682
|
+
} else {
|
1683
|
+
self.append(', ');
|
1684
|
+
}
|
1685
|
+
|
1686
|
+
self.formatProperty(array, property, isGetter);
|
1687
|
+
});
|
1688
|
+
|
1645
1689
|
this.append(' ]');
|
1646
1690
|
};
|
1647
1691
|
|
@@ -1664,18 +1708,22 @@ getJasmineRequireObj().pp = function(j$) {
|
|
1664
1708
|
self.append(', ');
|
1665
1709
|
}
|
1666
1710
|
|
1667
|
-
self.
|
1668
|
-
self.append(': ');
|
1669
|
-
if (isGetter) {
|
1670
|
-
self.append('<getter>');
|
1671
|
-
} else {
|
1672
|
-
self.format(obj[property]);
|
1673
|
-
}
|
1711
|
+
self.formatProperty(obj, property, isGetter);
|
1674
1712
|
});
|
1675
1713
|
|
1676
1714
|
this.append(' })');
|
1677
1715
|
};
|
1678
1716
|
|
1717
|
+
StringPrettyPrinter.prototype.formatProperty = function(obj, property, isGetter) {
|
1718
|
+
this.append(property);
|
1719
|
+
this.append(': ');
|
1720
|
+
if (isGetter) {
|
1721
|
+
this.append('<getter>');
|
1722
|
+
} else {
|
1723
|
+
this.format(obj[property]);
|
1724
|
+
}
|
1725
|
+
};
|
1726
|
+
|
1679
1727
|
StringPrettyPrinter.prototype.append = function(value) {
|
1680
1728
|
this.string += value;
|
1681
1729
|
};
|
@@ -1706,7 +1754,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|
1706
1754
|
this.onException = attrs.onException || function() {};
|
1707
1755
|
this.catchException = attrs.catchException || function() { return true; };
|
1708
1756
|
this.userContext = attrs.userContext || {};
|
1709
|
-
this.
|
1757
|
+
this.timeout = attrs.timeout || {setTimeout: setTimeout, clearTimeout: clearTimeout};
|
1710
1758
|
this.fail = attrs.fail || function() {};
|
1711
1759
|
}
|
1712
1760
|
|
@@ -1746,7 +1794,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|
1746
1794
|
|
1747
1795
|
function attemptAsync(queueableFn) {
|
1748
1796
|
var clearTimeout = function () {
|
1749
|
-
Function.prototype.apply.apply(self.
|
1797
|
+
Function.prototype.apply.apply(self.timeout.clearTimeout, [j$.getGlobal(), [timeoutId]]);
|
1750
1798
|
},
|
1751
1799
|
next = once(function () {
|
1752
1800
|
clearTimeout(timeoutId);
|
@@ -1760,7 +1808,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
|
1760
1808
|
};
|
1761
1809
|
|
1762
1810
|
if (queueableFn.timeout) {
|
1763
|
-
timeoutId = Function.prototype.apply.apply(self.
|
1811
|
+
timeoutId = Function.prototype.apply.apply(self.timeout.setTimeout, [j$.getGlobal(), [function() {
|
1764
1812
|
var error = new Error('Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.');
|
1765
1813
|
onException(error, queueableFn);
|
1766
1814
|
next();
|
@@ -1938,24 +1986,20 @@ getJasmineRequireObj().SpyStrategy = function() {
|
|
1938
1986
|
return SpyStrategy;
|
1939
1987
|
};
|
1940
1988
|
|
1941
|
-
getJasmineRequireObj().Suite = function() {
|
1989
|
+
getJasmineRequireObj().Suite = function(j$) {
|
1942
1990
|
function Suite(attrs) {
|
1943
1991
|
this.env = attrs.env;
|
1944
1992
|
this.id = attrs.id;
|
1945
1993
|
this.parentSuite = attrs.parentSuite;
|
1946
1994
|
this.description = attrs.description;
|
1947
|
-
this.onStart = attrs.onStart || function() {};
|
1948
|
-
this.resultCallback = attrs.resultCallback || function() {};
|
1949
|
-
this.clearStack = attrs.clearStack || function(fn) {fn();};
|
1950
1995
|
this.expectationFactory = attrs.expectationFactory;
|
1951
1996
|
this.expectationResultFactory = attrs.expectationResultFactory;
|
1952
|
-
this.
|
1997
|
+
this.throwOnExpectationFailure = !!attrs.throwOnExpectationFailure;
|
1953
1998
|
|
1954
1999
|
this.beforeFns = [];
|
1955
2000
|
this.afterFns = [];
|
1956
2001
|
this.beforeAllFns = [];
|
1957
2002
|
this.afterAllFns = [];
|
1958
|
-
this.queueRunner = attrs.queueRunner || function() {};
|
1959
2003
|
this.disabled = false;
|
1960
2004
|
|
1961
2005
|
this.children = [];
|
@@ -2018,51 +2062,17 @@ getJasmineRequireObj().Suite = function() {
|
|
2018
2062
|
}
|
2019
2063
|
};
|
2020
2064
|
|
2021
|
-
Suite.prototype.
|
2022
|
-
|
2023
|
-
|
2024
|
-
this.onStart(this);
|
2025
|
-
|
2026
|
-
if (this.disabled) {
|
2027
|
-
complete();
|
2028
|
-
return;
|
2029
|
-
}
|
2030
|
-
|
2031
|
-
var allFns = [];
|
2032
|
-
|
2033
|
-
for (var i = 0; i < this.children.length; i++) {
|
2034
|
-
allFns.push(wrapChildAsAsync(this.children[i]));
|
2035
|
-
}
|
2036
|
-
|
2037
|
-
if (this.isExecutable()) {
|
2038
|
-
allFns = this.beforeAllFns.concat(allFns);
|
2039
|
-
allFns = allFns.concat(this.afterAllFns);
|
2040
|
-
}
|
2041
|
-
|
2042
|
-
this.queueRunner({
|
2043
|
-
queueableFns: allFns,
|
2044
|
-
onComplete: complete,
|
2045
|
-
userContext: this.sharedUserContext(),
|
2046
|
-
onException: function() { self.onException.apply(self, arguments); }
|
2047
|
-
});
|
2048
|
-
|
2049
|
-
function complete() {
|
2050
|
-
self.result.status = self.status();
|
2051
|
-
self.resultCallback(self.result);
|
2052
|
-
|
2053
|
-
if (onComplete) {
|
2054
|
-
onComplete();
|
2055
|
-
}
|
2056
|
-
}
|
2065
|
+
Suite.prototype.isExecutable = function() {
|
2066
|
+
return !this.disabled;
|
2067
|
+
};
|
2057
2068
|
|
2058
|
-
|
2059
|
-
|
2060
|
-
}
|
2069
|
+
Suite.prototype.canBeReentered = function() {
|
2070
|
+
return this.beforeAllFns.length === 0 && this.afterAllFns.length === 0;
|
2061
2071
|
};
|
2062
2072
|
|
2063
|
-
Suite.prototype.
|
2064
|
-
|
2065
|
-
return
|
2073
|
+
Suite.prototype.getResult = function() {
|
2074
|
+
this.result.status = this.status();
|
2075
|
+
return this.result;
|
2066
2076
|
};
|
2067
2077
|
|
2068
2078
|
Suite.prototype.sharedUserContext = function() {
|
@@ -2078,6 +2088,10 @@ getJasmineRequireObj().Suite = function() {
|
|
2078
2088
|
};
|
2079
2089
|
|
2080
2090
|
Suite.prototype.onException = function() {
|
2091
|
+
if (arguments[0] instanceof j$.errors.ExpectationFailed) {
|
2092
|
+
return;
|
2093
|
+
}
|
2094
|
+
|
2081
2095
|
if(isAfterAll(this.children)) {
|
2082
2096
|
var data = {
|
2083
2097
|
matcherName: '',
|
@@ -2099,10 +2113,17 @@ getJasmineRequireObj().Suite = function() {
|
|
2099
2113
|
if(isAfterAll(this.children) && isFailure(arguments)){
|
2100
2114
|
var data = arguments[1];
|
2101
2115
|
this.result.failedExpectations.push(this.expectationResultFactory(data));
|
2116
|
+
if(this.throwOnExpectationFailure) {
|
2117
|
+
throw new j$.errors.ExpectationFailed();
|
2118
|
+
}
|
2102
2119
|
} else {
|
2103
2120
|
for (var i = 0; i < this.children.length; i++) {
|
2104
2121
|
var child = this.children[i];
|
2105
|
-
|
2122
|
+
try {
|
2123
|
+
child.addExpectationResult.apply(child, arguments);
|
2124
|
+
} catch(e) {
|
2125
|
+
// keep going
|
2126
|
+
}
|
2106
2127
|
}
|
2107
2128
|
}
|
2108
2129
|
};
|
@@ -2115,17 +2136,6 @@ getJasmineRequireObj().Suite = function() {
|
|
2115
2136
|
return !args[0];
|
2116
2137
|
}
|
2117
2138
|
|
2118
|
-
function hasExecutableChild(children) {
|
2119
|
-
var foundActive = false;
|
2120
|
-
for (var i = 0; i < children.length; i++) {
|
2121
|
-
if (children[i].isExecutable()) {
|
2122
|
-
foundActive = true;
|
2123
|
-
break;
|
2124
|
-
}
|
2125
|
-
}
|
2126
|
-
return foundActive;
|
2127
|
-
}
|
2128
|
-
|
2129
2139
|
function clone(obj) {
|
2130
2140
|
var clonedObj = {};
|
2131
2141
|
for (var prop in obj) {
|
@@ -2167,7 +2177,211 @@ getJasmineRequireObj().Timer = function() {
|
|
2167
2177
|
return Timer;
|
2168
2178
|
};
|
2169
2179
|
|
2170
|
-
getJasmineRequireObj().
|
2180
|
+
getJasmineRequireObj().TreeProcessor = function() {
|
2181
|
+
function TreeProcessor(attrs) {
|
2182
|
+
var tree = attrs.tree,
|
2183
|
+
runnableIds = attrs.runnableIds,
|
2184
|
+
queueRunnerFactory = attrs.queueRunnerFactory,
|
2185
|
+
nodeStart = attrs.nodeStart || function() {},
|
2186
|
+
nodeComplete = attrs.nodeComplete || function() {},
|
2187
|
+
stats = { valid: true },
|
2188
|
+
processed = false,
|
2189
|
+
defaultMin = Infinity,
|
2190
|
+
defaultMax = 1 - Infinity;
|
2191
|
+
|
2192
|
+
this.processTree = function() {
|
2193
|
+
processNode(tree, false);
|
2194
|
+
processed = true;
|
2195
|
+
return stats;
|
2196
|
+
};
|
2197
|
+
|
2198
|
+
this.execute = function(done) {
|
2199
|
+
if (!processed) {
|
2200
|
+
this.processTree();
|
2201
|
+
}
|
2202
|
+
|
2203
|
+
if (!stats.valid) {
|
2204
|
+
throw 'invalid order';
|
2205
|
+
}
|
2206
|
+
|
2207
|
+
var childFns = wrapChildren(tree, 0);
|
2208
|
+
|
2209
|
+
queueRunnerFactory({
|
2210
|
+
queueableFns: childFns,
|
2211
|
+
onException: function() {
|
2212
|
+
tree.onException.apply(tree, arguments);
|
2213
|
+
},
|
2214
|
+
onComplete: done
|
2215
|
+
});
|
2216
|
+
};
|
2217
|
+
|
2218
|
+
function runnableIndex(id) {
|
2219
|
+
for (var i = 0; i < runnableIds.length; i++) {
|
2220
|
+
if (runnableIds[i] === id) {
|
2221
|
+
return i;
|
2222
|
+
}
|
2223
|
+
}
|
2224
|
+
}
|
2225
|
+
|
2226
|
+
function processNode(node, parentEnabled) {
|
2227
|
+
var executableIndex = runnableIndex(node.id);
|
2228
|
+
|
2229
|
+
if (executableIndex !== undefined) {
|
2230
|
+
parentEnabled = true;
|
2231
|
+
}
|
2232
|
+
|
2233
|
+
parentEnabled = parentEnabled && node.isExecutable();
|
2234
|
+
|
2235
|
+
if (!node.children) {
|
2236
|
+
stats[node.id] = {
|
2237
|
+
executable: parentEnabled && node.isExecutable(),
|
2238
|
+
segments: [{
|
2239
|
+
index: 0,
|
2240
|
+
owner: node,
|
2241
|
+
nodes: [node],
|
2242
|
+
min: startingMin(executableIndex),
|
2243
|
+
max: startingMax(executableIndex)
|
2244
|
+
}]
|
2245
|
+
};
|
2246
|
+
} else {
|
2247
|
+
var hasExecutableChild = false;
|
2248
|
+
|
2249
|
+
for (var i = 0; i < node.children.length; i++) {
|
2250
|
+
var child = node.children[i];
|
2251
|
+
|
2252
|
+
processNode(child, parentEnabled);
|
2253
|
+
|
2254
|
+
if (!stats.valid) {
|
2255
|
+
return;
|
2256
|
+
}
|
2257
|
+
|
2258
|
+
var childStats = stats[child.id];
|
2259
|
+
|
2260
|
+
hasExecutableChild = hasExecutableChild || childStats.executable;
|
2261
|
+
}
|
2262
|
+
|
2263
|
+
stats[node.id] = {
|
2264
|
+
executable: hasExecutableChild
|
2265
|
+
};
|
2266
|
+
|
2267
|
+
segmentChildren(node, stats[node.id], executableIndex);
|
2268
|
+
|
2269
|
+
if (!node.canBeReentered() && stats[node.id].segments.length > 1) {
|
2270
|
+
stats = { valid: false };
|
2271
|
+
}
|
2272
|
+
}
|
2273
|
+
}
|
2274
|
+
|
2275
|
+
function startingMin(executableIndex) {
|
2276
|
+
return executableIndex === undefined ? defaultMin : executableIndex;
|
2277
|
+
}
|
2278
|
+
|
2279
|
+
function startingMax(executableIndex) {
|
2280
|
+
return executableIndex === undefined ? defaultMax : executableIndex;
|
2281
|
+
}
|
2282
|
+
|
2283
|
+
function segmentChildren(node, nodeStats, executableIndex) {
|
2284
|
+
var currentSegment = { index: 0, owner: node, nodes: [], min: startingMin(executableIndex), max: startingMax(executableIndex) },
|
2285
|
+
result = [currentSegment],
|
2286
|
+
lastMax = defaultMax,
|
2287
|
+
orderedChildSegments = orderChildSegments(node.children);
|
2288
|
+
|
2289
|
+
function isSegmentBoundary(minIndex) {
|
2290
|
+
return lastMax !== defaultMax && minIndex !== defaultMin && lastMax < minIndex - 1;
|
2291
|
+
}
|
2292
|
+
|
2293
|
+
for (var i = 0; i < orderedChildSegments.length; i++) {
|
2294
|
+
var childSegment = orderedChildSegments[i],
|
2295
|
+
maxIndex = childSegment.max,
|
2296
|
+
minIndex = childSegment.min;
|
2297
|
+
|
2298
|
+
if (isSegmentBoundary(minIndex)) {
|
2299
|
+
currentSegment = {index: result.length, owner: node, nodes: [], min: defaultMin, max: defaultMax};
|
2300
|
+
result.push(currentSegment);
|
2301
|
+
}
|
2302
|
+
|
2303
|
+
currentSegment.nodes.push(childSegment);
|
2304
|
+
currentSegment.min = Math.min(currentSegment.min, minIndex);
|
2305
|
+
currentSegment.max = Math.max(currentSegment.max, maxIndex);
|
2306
|
+
lastMax = maxIndex;
|
2307
|
+
}
|
2308
|
+
|
2309
|
+
nodeStats.segments = result;
|
2310
|
+
}
|
2311
|
+
|
2312
|
+
function orderChildSegments(children) {
|
2313
|
+
var result = [];
|
2314
|
+
|
2315
|
+
for (var i = 0; i < children.length; i++) {
|
2316
|
+
var child = children[i],
|
2317
|
+
segments = stats[child.id].segments;
|
2318
|
+
|
2319
|
+
for (var j = 0; j < segments.length; j++) {
|
2320
|
+
result.push(segments[j]);
|
2321
|
+
}
|
2322
|
+
}
|
2323
|
+
|
2324
|
+
result.sort(function(a, b) {
|
2325
|
+
if (a.min === null) {
|
2326
|
+
return b.min === null ? 0 : 1;
|
2327
|
+
}
|
2328
|
+
|
2329
|
+
if (b.min === null) {
|
2330
|
+
return -1;
|
2331
|
+
}
|
2332
|
+
|
2333
|
+
return a.min - b.min;
|
2334
|
+
});
|
2335
|
+
|
2336
|
+
return result;
|
2337
|
+
}
|
2338
|
+
|
2339
|
+
function executeNode(node, segmentNumber) {
|
2340
|
+
if (node.children) {
|
2341
|
+
return {
|
2342
|
+
fn: function(done) {
|
2343
|
+
nodeStart(node);
|
2344
|
+
|
2345
|
+
queueRunnerFactory({
|
2346
|
+
onComplete: function() {
|
2347
|
+
nodeComplete(node, node.getResult());
|
2348
|
+
done();
|
2349
|
+
},
|
2350
|
+
queueableFns: wrapChildren(node, segmentNumber),
|
2351
|
+
userContext: node.sharedUserContext(),
|
2352
|
+
onException: function() {
|
2353
|
+
node.onException.apply(node, arguments);
|
2354
|
+
}
|
2355
|
+
});
|
2356
|
+
}
|
2357
|
+
};
|
2358
|
+
} else {
|
2359
|
+
return {
|
2360
|
+
fn: function(done) { node.execute(done, stats[node.id].executable); }
|
2361
|
+
};
|
2362
|
+
}
|
2363
|
+
}
|
2364
|
+
|
2365
|
+
function wrapChildren(node, segmentNumber) {
|
2366
|
+
var result = [],
|
2367
|
+
segmentChildren = stats[node.id].segments[segmentNumber].nodes;
|
2368
|
+
|
2369
|
+
for (var i = 0; i < segmentChildren.length; i++) {
|
2370
|
+
result.push(executeNode(segmentChildren[i].owner, segmentChildren[i].index));
|
2371
|
+
}
|
2372
|
+
|
2373
|
+
if (!stats[node.id].executable) {
|
2374
|
+
return result;
|
2375
|
+
}
|
2376
|
+
|
2377
|
+
return node.beforeAllFns.concat(result).concat(node.afterAllFns);
|
2378
|
+
}
|
2379
|
+
}
|
2380
|
+
|
2381
|
+
return TreeProcessor;
|
2382
|
+
};
|
2383
|
+
|
2384
|
+
getJasmineRequireObj().Any = function(j$) {
|
2171
2385
|
|
2172
2386
|
function Any(expectedObject) {
|
2173
2387
|
this.expectedObject = expectedObject;
|
@@ -2198,7 +2412,7 @@ getJasmineRequireObj().Any = function() {
|
|
2198
2412
|
};
|
2199
2413
|
|
2200
2414
|
Any.prototype.jasmineToString = function() {
|
2201
|
-
return '<jasmine.any(' + this.expectedObject + ')>';
|
2415
|
+
return '<jasmine.any(' + j$.fnNameFor(this.expectedObject) + ')>';
|
2202
2416
|
};
|
2203
2417
|
|
2204
2418
|
return Any;
|
@@ -2251,11 +2465,35 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
|
2251
2465
|
this.sample = sample;
|
2252
2466
|
}
|
2253
2467
|
|
2468
|
+
function getPrototype(obj) {
|
2469
|
+
if (Object.getPrototypeOf) {
|
2470
|
+
return Object.getPrototypeOf(obj);
|
2471
|
+
}
|
2472
|
+
|
2473
|
+
if (obj.constructor.prototype == obj) {
|
2474
|
+
return null;
|
2475
|
+
}
|
2476
|
+
|
2477
|
+
return obj.constructor.prototype;
|
2478
|
+
}
|
2479
|
+
|
2480
|
+
function hasProperty(obj, property) {
|
2481
|
+
if (!obj) {
|
2482
|
+
return false;
|
2483
|
+
}
|
2484
|
+
|
2485
|
+
if (Object.prototype.hasOwnProperty.call(obj, property)) {
|
2486
|
+
return true;
|
2487
|
+
}
|
2488
|
+
|
2489
|
+
return hasProperty(getPrototype(obj), property);
|
2490
|
+
}
|
2491
|
+
|
2254
2492
|
ObjectContaining.prototype.asymmetricMatch = function(other) {
|
2255
2493
|
if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); }
|
2256
2494
|
|
2257
2495
|
for (var property in this.sample) {
|
2258
|
-
if (!
|
2496
|
+
if (!hasProperty(other, property) ||
|
2259
2497
|
!j$.matchersUtil.equals(this.sample[property], other[property])) {
|
2260
2498
|
return false;
|
2261
2499
|
}
|
@@ -2292,6 +2530,16 @@ getJasmineRequireObj().StringMatching = function(j$) {
|
|
2292
2530
|
return StringMatching;
|
2293
2531
|
};
|
2294
2532
|
|
2533
|
+
getJasmineRequireObj().errors = function() {
|
2534
|
+
function ExpectationFailed() {}
|
2535
|
+
|
2536
|
+
ExpectationFailed.prototype = new Error();
|
2537
|
+
ExpectationFailed.prototype.constructor = ExpectationFailed;
|
2538
|
+
|
2539
|
+
return {
|
2540
|
+
ExpectationFailed: ExpectationFailed
|
2541
|
+
};
|
2542
|
+
};
|
2295
2543
|
getJasmineRequireObj().matchersUtil = function(j$) {
|
2296
2544
|
// TODO: what to do about jasmine.pp not being inject? move to JSON.stringify? gut PrettyPrinter?
|
2297
2545
|
|
@@ -2461,11 +2709,13 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
|
2461
2709
|
|
2462
2710
|
if (result) {
|
2463
2711
|
// Objects with different constructors are not equivalent, but `Object`s
|
2464
|
-
// from different frames are.
|
2465
|
-
|
2466
|
-
|
2467
|
-
|
2468
|
-
|
2712
|
+
// or `Array`s from different frames are.
|
2713
|
+
if (className !== '[object Array]') {
|
2714
|
+
var aCtor = a.constructor, bCtor = b.constructor;
|
2715
|
+
if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&
|
2716
|
+
isFunction(bCtor) && bCtor instanceof bCtor)) {
|
2717
|
+
return false;
|
2718
|
+
}
|
2469
2719
|
}
|
2470
2720
|
// Deep compare objects.
|
2471
2721
|
for (var key in a) {
|
@@ -2939,7 +3189,7 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
|
2939
3189
|
return expected === null && errorType === null;
|
2940
3190
|
},
|
2941
3191
|
matches: function(error) {
|
2942
|
-
return (errorType === null || error
|
3192
|
+
return (errorType === null || error instanceof errorType) &&
|
2943
3193
|
(expected === null || messageMatch(error.message));
|
2944
3194
|
}
|
2945
3195
|
};
|
@@ -3044,5 +3294,5 @@ getJasmineRequireObj().interface = function(jasmine, env) {
|
|
3044
3294
|
};
|
3045
3295
|
|
3046
3296
|
getJasmineRequireObj().version = function() {
|
3047
|
-
return '2.
|
3297
|
+
return '2.3.0';
|
3048
3298
|
};
|