jasmine-core 2.3.4 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jasmine-core/boot.js +9 -0
- data/lib/jasmine-core/boot/boot.js +9 -0
- data/lib/jasmine-core/jasmine-html.js +87 -60
- data/lib/jasmine-core/jasmine.css +51 -51
- data/lib/jasmine-core/jasmine.js +176 -20
- data/lib/jasmine-core/spec/core/EnvSpec.js +20 -0
- data/lib/jasmine-core/spec/core/JsApiReporterSpec.js +8 -0
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +8 -0
- data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +29 -0
- data/lib/jasmine-core/spec/core/SuiteSpec.js +15 -0
- data/lib/jasmine-core/spec/core/TreeProcessorSpec.js +63 -0
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js +7 -0
- data/lib/jasmine-core/spec/core/integration/EnvSpec.js +80 -6
- data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +102 -3
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledTimesSpec.js +81 -0
- data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +8 -8
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +190 -54
- data/lib/jasmine-core/version.rb +1 -1
- metadata +4 -3
@@ -146,7 +146,7 @@ describe("toThrowError", function() {
|
|
146
146
|
var util = {
|
147
147
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
148
148
|
},
|
149
|
-
matcher = j$.matchers.toThrowError(
|
149
|
+
matcher = j$.matchers.toThrowError(),
|
150
150
|
fn = function() {
|
151
151
|
throw new Error();
|
152
152
|
},
|
@@ -162,7 +162,7 @@ describe("toThrowError", function() {
|
|
162
162
|
var util = {
|
163
163
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
164
164
|
},
|
165
|
-
matcher = j$.matchers.toThrowError(
|
165
|
+
matcher = j$.matchers.toThrowError(),
|
166
166
|
CustomError = function CustomError(arg) { arg.x },
|
167
167
|
fn = function() {
|
168
168
|
throw new CustomError({ x: 1 });
|
@@ -181,7 +181,7 @@ describe("toThrowError", function() {
|
|
181
181
|
var util = {
|
182
182
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
|
183
183
|
},
|
184
|
-
matcher = j$.matchers.toThrowError(
|
184
|
+
matcher = j$.matchers.toThrowError(),
|
185
185
|
fn = function() {
|
186
186
|
throw new Error();
|
187
187
|
},
|
@@ -197,7 +197,7 @@ describe("toThrowError", function() {
|
|
197
197
|
var util = {
|
198
198
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
199
199
|
},
|
200
|
-
matcher = j$.matchers.toThrowError(
|
200
|
+
matcher = j$.matchers.toThrowError(),
|
201
201
|
fn = function() {
|
202
202
|
throw new TypeError("foo");
|
203
203
|
},
|
@@ -213,7 +213,7 @@ describe("toThrowError", function() {
|
|
213
213
|
var util = {
|
214
214
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
215
215
|
},
|
216
|
-
matcher = j$.matchers.toThrowError(
|
216
|
+
matcher = j$.matchers.toThrowError(),
|
217
217
|
CustomError = function CustomError(arg) { this.message = arg.message },
|
218
218
|
fn = function() {
|
219
219
|
throw new CustomError({message: "foo"});
|
@@ -232,7 +232,7 @@ describe("toThrowError", function() {
|
|
232
232
|
var util = {
|
233
233
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
|
234
234
|
},
|
235
|
-
matcher = j$.matchers.toThrowError(
|
235
|
+
matcher = j$.matchers.toThrowError(),
|
236
236
|
fn = function() {
|
237
237
|
throw new TypeError("foo");
|
238
238
|
},
|
@@ -248,7 +248,7 @@ describe("toThrowError", function() {
|
|
248
248
|
var util = {
|
249
249
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(true)
|
250
250
|
},
|
251
|
-
matcher = j$.matchers.toThrowError(
|
251
|
+
matcher = j$.matchers.toThrowError(),
|
252
252
|
fn = function() {
|
253
253
|
throw new TypeError("foo");
|
254
254
|
},
|
@@ -264,7 +264,7 @@ describe("toThrowError", function() {
|
|
264
264
|
var util = {
|
265
265
|
equals: jasmine.createSpy('delegated-equal').and.returnValue(false)
|
266
266
|
},
|
267
|
-
matcher = j$.matchers.toThrowError(
|
267
|
+
matcher = j$.matchers.toThrowError(),
|
268
268
|
fn = function() {
|
269
269
|
throw new TypeError("foo");
|
270
270
|
},
|
@@ -14,20 +14,20 @@ describe("New HtmlReporter", function() {
|
|
14
14
|
|
15
15
|
// Main top-level elements
|
16
16
|
expect(container.querySelector("div.jasmine_html-reporter")).toBeTruthy();
|
17
|
-
expect(container.querySelector("div.banner")).toBeTruthy();
|
18
|
-
expect(container.querySelector("div.alert")).toBeTruthy();
|
19
|
-
expect(container.querySelector("div.results")).toBeTruthy();
|
17
|
+
expect(container.querySelector("div.jasmine-banner")).toBeTruthy();
|
18
|
+
expect(container.querySelector("div.jasmine-alert")).toBeTruthy();
|
19
|
+
expect(container.querySelector("div.jasmine-results")).toBeTruthy();
|
20
20
|
|
21
|
-
expect(container.querySelector("ul.symbol-summary")).toBeTruthy();
|
21
|
+
expect(container.querySelector("ul.jasmine-symbol-summary")).toBeTruthy();
|
22
22
|
|
23
23
|
// title banner
|
24
|
-
var banner = container.querySelector(".banner");
|
24
|
+
var banner = container.querySelector(".jasmine-banner");
|
25
25
|
|
26
|
-
var title = banner.querySelector("a.title");
|
26
|
+
var title = banner.querySelector("a.jasmine-title");
|
27
27
|
expect(title.getAttribute('href')).toEqual('http://jasmine.github.io/');
|
28
28
|
expect(title.getAttribute('target')).toEqual('_blank');
|
29
29
|
|
30
|
-
var version = banner.querySelector(".version"),
|
30
|
+
var version = banner.querySelector(".jasmine-version"),
|
31
31
|
versionText = 'textContent' in version ? version.textContent : version.innerText;
|
32
32
|
expect(versionText).toEqual(j$.version);
|
33
33
|
});
|
@@ -90,8 +90,8 @@ describe("New HtmlReporter", function() {
|
|
90
90
|
failedExpectations: []
|
91
91
|
});
|
92
92
|
expect(console.error).toHaveBeenCalledWith("Spec \'Some Name\' has no expectations.");
|
93
|
-
var specEl = container.querySelector('.symbol-summary li');
|
94
|
-
expect(specEl.getAttribute("class")).toEqual("empty");
|
93
|
+
var specEl = container.querySelector('.jasmine-symbol-summary li');
|
94
|
+
expect(specEl.getAttribute("class")).toEqual("jasmine-empty");
|
95
95
|
});
|
96
96
|
|
97
97
|
it("reports the status symbol of a disabled spec", function() {
|
@@ -108,8 +108,8 @@ describe("New HtmlReporter", function() {
|
|
108
108
|
|
109
109
|
reporter.specDone({id: 789, status: "disabled", fullName: "symbols should have titles", passedExpectations: [], failedExpectations: []});
|
110
110
|
|
111
|
-
var specEl = container.querySelector('.symbol-summary li');
|
112
|
-
expect(specEl.getAttribute("class")).toEqual("disabled");
|
111
|
+
var specEl = container.querySelector('.jasmine-symbol-summary li');
|
112
|
+
expect(specEl.getAttribute("class")).toEqual("jasmine-disabled");
|
113
113
|
expect(specEl.getAttribute("id")).toEqual("spec_789");
|
114
114
|
expect(specEl.getAttribute("title")).toEqual("symbols should have titles");
|
115
115
|
});
|
@@ -128,8 +128,8 @@ describe("New HtmlReporter", function() {
|
|
128
128
|
|
129
129
|
reporter.specDone({id: 789, status: "pending", passedExpectations: [], failedExpectations: []});
|
130
130
|
|
131
|
-
var specEl = container.querySelector('.symbol-summary li');
|
132
|
-
expect(specEl.getAttribute("class")).toEqual("pending");
|
131
|
+
var specEl = container.querySelector('.jasmine-symbol-summary li');
|
132
|
+
expect(specEl.getAttribute("class")).toEqual("jasmine-pending");
|
133
133
|
expect(specEl.getAttribute("id")).toEqual("spec_789");
|
134
134
|
});
|
135
135
|
|
@@ -147,9 +147,9 @@ describe("New HtmlReporter", function() {
|
|
147
147
|
|
148
148
|
reporter.specDone({id: 123, status: "passed", passedExpectations: [{passed: true}], failedExpectations: []});
|
149
149
|
|
150
|
-
var statuses = container.querySelector(".symbol-summary");
|
150
|
+
var statuses = container.querySelector(".jasmine-symbol-summary");
|
151
151
|
var specEl = statuses.querySelector("li");
|
152
|
-
expect(specEl.getAttribute("class")).toEqual("passed");
|
152
|
+
expect(specEl.getAttribute("class")).toEqual("jasmine-passed");
|
153
153
|
expect(specEl.getAttribute("id")).toEqual("spec_123");
|
154
154
|
});
|
155
155
|
|
@@ -173,8 +173,8 @@ describe("New HtmlReporter", function() {
|
|
173
173
|
passedExpectations: []
|
174
174
|
});
|
175
175
|
|
176
|
-
var specEl = container.querySelector(".symbol-summary li");
|
177
|
-
expect(specEl.getAttribute("class")).toEqual("failed");
|
176
|
+
var specEl = container.querySelector(".jasmine-symbol-summary li");
|
177
|
+
expect(specEl.getAttribute("class")).toEqual("jasmine-failed");
|
178
178
|
expect(specEl.getAttribute("id")).toEqual("spec_345");
|
179
179
|
});
|
180
180
|
});
|
@@ -198,11 +198,11 @@ describe("New HtmlReporter", function() {
|
|
198
198
|
reporter.suiteDone({ status: 'failed', failedExpectations: [{ message: 'My Other Exception' }] });
|
199
199
|
reporter.jasmineDone({});
|
200
200
|
|
201
|
-
var alertBars = container.querySelectorAll(".alert .bar");
|
201
|
+
var alertBars = container.querySelectorAll(".jasmine-alert .jasmine-bar");
|
202
202
|
|
203
203
|
expect(alertBars.length).toEqual(3);
|
204
204
|
expect(alertBars[1].innerHTML).toMatch(/My After All Exception/);
|
205
|
-
expect(alertBars[1].getAttribute("class")).toEqual('bar errored');
|
205
|
+
expect(alertBars[1].getAttribute("class")).toEqual('jasmine-bar jasmine-errored');
|
206
206
|
expect(alertBars[2].innerHTML).toMatch(/My Other Exception/);
|
207
207
|
});
|
208
208
|
});
|
@@ -238,7 +238,7 @@ describe("New HtmlReporter", function() {
|
|
238
238
|
reporter.suiteDone({id: 1});
|
239
239
|
reporter.jasmineDone({});
|
240
240
|
|
241
|
-
var summary = container.querySelector('.summary');
|
241
|
+
var summary = container.querySelector('.jasmine-summary');
|
242
242
|
var suite = summary.childNodes[0];
|
243
243
|
var specs = suite.childNodes[1];
|
244
244
|
var spec = specs.childNodes[0];
|
@@ -266,7 +266,7 @@ describe("New HtmlReporter", function() {
|
|
266
266
|
timer.elapsed.and.returnValue(100);
|
267
267
|
reporter.jasmineDone();
|
268
268
|
|
269
|
-
var duration = container.querySelector(".alert .duration");
|
269
|
+
var duration = container.querySelector(".jasmine-alert .jasmine-duration");
|
270
270
|
expect(duration.innerHTML).toMatch(/finished in 0.1s/);
|
271
271
|
});
|
272
272
|
|
@@ -334,7 +334,7 @@ describe("New HtmlReporter", function() {
|
|
334
334
|
reporter.suiteDone({id: 1});
|
335
335
|
|
336
336
|
reporter.jasmineDone({});
|
337
|
-
var summary = container.querySelector(".summary");
|
337
|
+
var summary = container.querySelector(".jasmine-summary");
|
338
338
|
|
339
339
|
expect(summary.childNodes.length).toEqual(1);
|
340
340
|
|
@@ -346,7 +346,7 @@ describe("New HtmlReporter", function() {
|
|
346
346
|
var node = outerSuite.childNodes[i];
|
347
347
|
classes.push(node.getAttribute("class"));
|
348
348
|
}
|
349
|
-
expect(classes).toEqual(["suite-detail", "specs", "suite", "specs"]);
|
349
|
+
expect(classes).toEqual(["jasmine-suite-detail", "jasmine-specs", "jasmine-suite", "jasmine-specs"]);
|
350
350
|
|
351
351
|
var suiteDetail = outerSuite.childNodes[0];
|
352
352
|
var suiteLink = suiteDetail.childNodes[0];
|
@@ -355,7 +355,7 @@ describe("New HtmlReporter", function() {
|
|
355
355
|
|
356
356
|
var specs = outerSuite.childNodes[1];
|
357
357
|
var spec = specs.childNodes[0];
|
358
|
-
expect(spec.getAttribute("class")).toEqual("passed");
|
358
|
+
expect(spec.getAttribute("class")).toEqual("jasmine-passed");
|
359
359
|
expect(spec.getAttribute("id")).toEqual("spec-123");
|
360
360
|
|
361
361
|
var specLink = spec.childNodes[0];
|
@@ -384,18 +384,18 @@ describe("New HtmlReporter", function() {
|
|
384
384
|
reporter.initialize();
|
385
385
|
reporter.jasmineDone({});
|
386
386
|
|
387
|
-
var trigger = container.querySelector('.run-options .trigger'),
|
388
|
-
payload = container.querySelector('.run-options .payload');
|
387
|
+
var trigger = container.querySelector('.jasmine-run-options .jasmine-trigger'),
|
388
|
+
payload = container.querySelector('.jasmine-run-options .jasmine-payload');
|
389
389
|
|
390
|
-
expect(payload.className).not.toContain('open');
|
390
|
+
expect(payload.className).not.toContain('jasmine-open');
|
391
391
|
|
392
392
|
trigger.onclick();
|
393
393
|
|
394
|
-
expect(payload.className).toContain('open');
|
394
|
+
expect(payload.className).toContain('jasmine-open');
|
395
395
|
|
396
396
|
trigger.onclick();
|
397
397
|
|
398
|
-
expect(payload.className).not.toContain('open');
|
398
|
+
expect(payload.className).not.toContain('jasmine-open');
|
399
399
|
});
|
400
400
|
|
401
401
|
describe("UI for raising/catching exceptions", function() {
|
@@ -419,7 +419,7 @@ describe("New HtmlReporter", function() {
|
|
419
419
|
reporter.initialize();
|
420
420
|
reporter.jasmineDone({});
|
421
421
|
|
422
|
-
var raisingExceptionsUI = container.querySelector(".raise");
|
422
|
+
var raisingExceptionsUI = container.querySelector(".jasmine-raise");
|
423
423
|
expect(raisingExceptionsUI.checked).toBe(false);
|
424
424
|
});
|
425
425
|
|
@@ -444,7 +444,7 @@ describe("New HtmlReporter", function() {
|
|
444
444
|
env.catchExceptions(false);
|
445
445
|
reporter.jasmineDone({});
|
446
446
|
|
447
|
-
var raisingExceptionsUI = container.querySelector(".raise");
|
447
|
+
var raisingExceptionsUI = container.querySelector(".jasmine-raise");
|
448
448
|
expect(raisingExceptionsUI.checked).toBe(true);
|
449
449
|
});
|
450
450
|
|
@@ -470,7 +470,7 @@ describe("New HtmlReporter", function() {
|
|
470
470
|
reporter.initialize();
|
471
471
|
reporter.jasmineDone({});
|
472
472
|
|
473
|
-
var input = container.querySelector(".raise");
|
473
|
+
var input = container.querySelector(".jasmine-raise");
|
474
474
|
input.click();
|
475
475
|
expect(exceptionsClickHandler).toHaveBeenCalled();
|
476
476
|
});
|
@@ -497,7 +497,7 @@ describe("New HtmlReporter", function() {
|
|
497
497
|
reporter.initialize();
|
498
498
|
reporter.jasmineDone({});
|
499
499
|
|
500
|
-
var throwingExpectationsUI = container.querySelector(".throw");
|
500
|
+
var throwingExpectationsUI = container.querySelector(".jasmine-throw");
|
501
501
|
expect(throwingExpectationsUI.checked).toBe(false);
|
502
502
|
});
|
503
503
|
|
@@ -523,7 +523,7 @@ describe("New HtmlReporter", function() {
|
|
523
523
|
reporter.initialize();
|
524
524
|
reporter.jasmineDone({});
|
525
525
|
|
526
|
-
var throwingExpectationsUI = container.querySelector(".throw");
|
526
|
+
var throwingExpectationsUI = container.querySelector(".jasmine-throw");
|
527
527
|
expect(throwingExpectationsUI.checked).toBe(true);
|
528
528
|
});
|
529
529
|
|
@@ -549,13 +549,149 @@ describe("New HtmlReporter", function() {
|
|
549
549
|
reporter.initialize();
|
550
550
|
reporter.jasmineDone({});
|
551
551
|
|
552
|
-
var throwingExpectationsUI = container.querySelector(".throw");
|
552
|
+
var throwingExpectationsUI = container.querySelector(".jasmine-throw");
|
553
553
|
throwingExpectationsUI.click();
|
554
554
|
|
555
555
|
expect(throwingExceptionHandler).toHaveBeenCalled();
|
556
556
|
});
|
557
557
|
});
|
558
558
|
|
559
|
+
describe("UI for running tests in random order", function() {
|
560
|
+
it("should be unchecked if not randomizing", function() {
|
561
|
+
var env = new j$.Env(),
|
562
|
+
container = document.createElement("div"),
|
563
|
+
getContainer = function() {
|
564
|
+
return container;
|
565
|
+
},
|
566
|
+
reporter = new j$.HtmlReporter({
|
567
|
+
env: env,
|
568
|
+
getContainer: getContainer,
|
569
|
+
createElement: function() {
|
570
|
+
return document.createElement.apply(document, arguments);
|
571
|
+
},
|
572
|
+
createTextNode: function() {
|
573
|
+
return document.createTextNode.apply(document, arguments);
|
574
|
+
}
|
575
|
+
});
|
576
|
+
|
577
|
+
reporter.initialize();
|
578
|
+
reporter.jasmineDone({});
|
579
|
+
|
580
|
+
var randomUI = container.querySelector(".jasmine-random");
|
581
|
+
expect(randomUI.checked).toBe(false);
|
582
|
+
});
|
583
|
+
|
584
|
+
it("should be checked if randomizing", function() {
|
585
|
+
var env = new j$.Env(),
|
586
|
+
container = document.createElement("div"),
|
587
|
+
getContainer = function() {
|
588
|
+
return container;
|
589
|
+
},
|
590
|
+
reporter = new j$.HtmlReporter({
|
591
|
+
env: env,
|
592
|
+
getContainer: getContainer,
|
593
|
+
createElement: function() {
|
594
|
+
return document.createElement.apply(document, arguments);
|
595
|
+
},
|
596
|
+
createTextNode: function() {
|
597
|
+
return document.createTextNode.apply(document, arguments);
|
598
|
+
}
|
599
|
+
});
|
600
|
+
|
601
|
+
env.randomizeTests(true);
|
602
|
+
reporter.initialize();
|
603
|
+
reporter.jasmineDone({});
|
604
|
+
|
605
|
+
var randomUI = container.querySelector(".jasmine-random");
|
606
|
+
expect(randomUI.checked).toBe(true);
|
607
|
+
});
|
608
|
+
|
609
|
+
it("should affect the query param for random tests", function() {
|
610
|
+
var env = new j$.Env(),
|
611
|
+
container = document.createElement("div"),
|
612
|
+
randomHandler = jasmine.createSpy('randomHandler'),
|
613
|
+
getContainer = function() {
|
614
|
+
return container;
|
615
|
+
},
|
616
|
+
reporter = new j$.HtmlReporter({
|
617
|
+
env: env,
|
618
|
+
getContainer: getContainer,
|
619
|
+
onRandomClick: randomHandler,
|
620
|
+
createElement: function() {
|
621
|
+
return document.createElement.apply(document, arguments);
|
622
|
+
},
|
623
|
+
createTextNode: function() {
|
624
|
+
return document.createTextNode.apply(document, arguments);
|
625
|
+
}
|
626
|
+
});
|
627
|
+
|
628
|
+
reporter.initialize();
|
629
|
+
reporter.jasmineDone({});
|
630
|
+
|
631
|
+
var randomUI = container.querySelector(".jasmine-random");
|
632
|
+
randomUI.click();
|
633
|
+
|
634
|
+
expect(randomHandler).toHaveBeenCalled();
|
635
|
+
});
|
636
|
+
|
637
|
+
it("should show the seed bar if randomizing", function() {
|
638
|
+
var env = new j$.Env(),
|
639
|
+
container = document.createElement("div"),
|
640
|
+
getContainer = function() {
|
641
|
+
return container;
|
642
|
+
},
|
643
|
+
reporter = new j$.HtmlReporter({
|
644
|
+
env: env,
|
645
|
+
getContainer: getContainer,
|
646
|
+
createElement: function() {
|
647
|
+
return document.createElement.apply(document, arguments);
|
648
|
+
},
|
649
|
+
createTextNode: function() {
|
650
|
+
return document.createTextNode.apply(document, arguments);
|
651
|
+
}
|
652
|
+
});
|
653
|
+
|
654
|
+
reporter.initialize();
|
655
|
+
reporter.jasmineDone({
|
656
|
+
order: {
|
657
|
+
random: true,
|
658
|
+
seed: '424242'
|
659
|
+
}
|
660
|
+
});
|
661
|
+
|
662
|
+
var seedBar = container.querySelector(".jasmine-seed-bar");
|
663
|
+
var seedBarText = 'textContent' in seedBar ? seedBar.textContent : seedBar.innerText;
|
664
|
+
expect(seedBarText).toBe(', randomized with seed 424242');
|
665
|
+
var seedLink = container.querySelector(".jasmine-seed-bar a");
|
666
|
+
expect(seedLink.getAttribute('href')).toBe('?seed=424242');
|
667
|
+
});
|
668
|
+
|
669
|
+
it("should not show the current seed bar if not randomizing", function() {
|
670
|
+
var env = new j$.Env(),
|
671
|
+
container = document.createElement("div"),
|
672
|
+
getContainer = function() {
|
673
|
+
return container;
|
674
|
+
},
|
675
|
+
reporter = new j$.HtmlReporter({
|
676
|
+
env: env,
|
677
|
+
getContainer: getContainer,
|
678
|
+
createElement: function() {
|
679
|
+
return document.createElement.apply(document, arguments);
|
680
|
+
},
|
681
|
+
createTextNode: function() {
|
682
|
+
return document.createTextNode.apply(document, arguments);
|
683
|
+
}
|
684
|
+
});
|
685
|
+
|
686
|
+
reporter.initialize();
|
687
|
+
reporter.jasmineDone();
|
688
|
+
|
689
|
+
var seedBar = container.querySelector(".jasmine-seed-bar");
|
690
|
+
expect(seedBar).toBeNull();
|
691
|
+
});
|
692
|
+
|
693
|
+
});
|
694
|
+
|
559
695
|
it("shows a message if no specs are run", function(){
|
560
696
|
var env, container, reporter;
|
561
697
|
env = new j$.Env();
|
@@ -572,8 +708,8 @@ describe("New HtmlReporter", function() {
|
|
572
708
|
reporter.jasmineStarted({});
|
573
709
|
reporter.jasmineDone({});
|
574
710
|
|
575
|
-
var alertBars = container.querySelectorAll(".alert .bar");
|
576
|
-
expect(alertBars[0].getAttribute('class')).toMatch(/skipped/);
|
711
|
+
var alertBars = container.querySelectorAll(".jasmine-alert .jasmine-bar");
|
712
|
+
expect(alertBars[0].getAttribute('class')).toMatch(/jasmine-skipped/);
|
577
713
|
expect(alertBars[0].innerHTML).toMatch(/No specs found/);
|
578
714
|
});
|
579
715
|
|
@@ -612,21 +748,21 @@ describe("New HtmlReporter", function() {
|
|
612
748
|
});
|
613
749
|
|
614
750
|
it("reports the specs counts", function() {
|
615
|
-
var alertBars = container.querySelectorAll(".alert .bar");
|
751
|
+
var alertBars = container.querySelectorAll(".jasmine-alert .jasmine-bar");
|
616
752
|
|
617
753
|
expect(alertBars.length).toEqual(1);
|
618
|
-
expect(alertBars[0].getAttribute('class')).toMatch(/passed/);
|
754
|
+
expect(alertBars[0].getAttribute('class')).toMatch(/jasmine-passed/);
|
619
755
|
expect(alertBars[0].innerHTML).toMatch(/2 specs, 0 failures/);
|
620
756
|
});
|
621
757
|
|
622
758
|
it("reports no failure details", function() {
|
623
|
-
var specFailure = container.querySelector(".failures");
|
759
|
+
var specFailure = container.querySelector(".jasmine-failures");
|
624
760
|
|
625
761
|
expect(specFailure.childNodes.length).toEqual(0);
|
626
762
|
});
|
627
763
|
|
628
764
|
it("reports no pending specs", function() {
|
629
|
-
var alertBar = container.querySelector(".alert .bar");
|
765
|
+
var alertBar = container.querySelector(".jasmine-alert .jasmine-bar");
|
630
766
|
|
631
767
|
expect(alertBar.innerHTML).not.toMatch(/pending spec[s]/);
|
632
768
|
});
|
@@ -662,19 +798,19 @@ describe("New HtmlReporter", function() {
|
|
662
798
|
});
|
663
799
|
|
664
800
|
it("reports the pending specs count", function() {
|
665
|
-
var alertBar = container.querySelector(".alert .bar");
|
801
|
+
var alertBar = container.querySelector(".jasmine-alert .jasmine-bar");
|
666
802
|
|
667
803
|
expect(alertBar.innerHTML).toMatch(/1 spec, 0 failures, 1 pending spec/);
|
668
804
|
});
|
669
805
|
|
670
806
|
it("reports no failure details", function() {
|
671
|
-
var specFailure = container.querySelector(".failures");
|
807
|
+
var specFailure = container.querySelector(".jasmine-failures");
|
672
808
|
|
673
809
|
expect(specFailure.childNodes.length).toEqual(0);
|
674
810
|
});
|
675
811
|
|
676
812
|
it("displays the custom pending reason", function() {
|
677
|
-
var pendingDetails = container.querySelector(".summary .pending");
|
813
|
+
var pendingDetails = container.querySelector(".jasmine-summary .jasmine-pending");
|
678
814
|
|
679
815
|
expect(pendingDetails.innerHTML).toContain("my custom pending reason");
|
680
816
|
});
|
@@ -721,37 +857,37 @@ describe("New HtmlReporter", function() {
|
|
721
857
|
});
|
722
858
|
|
723
859
|
it("reports the specs counts", function() {
|
724
|
-
var alertBar = container.querySelector(".alert .bar");
|
860
|
+
var alertBar = container.querySelector(".jasmine-alert .jasmine-bar");
|
725
861
|
|
726
|
-
expect(alertBar.getAttribute('class')).toMatch(/failed/);
|
862
|
+
expect(alertBar.getAttribute('class')).toMatch(/jasmine-failed/);
|
727
863
|
expect(alertBar.innerHTML).toMatch(/2 specs, 1 failure/);
|
728
864
|
});
|
729
865
|
|
730
866
|
it("reports failure messages and stack traces", function() {
|
731
|
-
var specFailures = container.querySelector(".failures");
|
867
|
+
var specFailures = container.querySelector(".jasmine-failures");
|
732
868
|
|
733
869
|
var failure = specFailures.childNodes[0];
|
734
|
-
expect(failure.getAttribute("class")).toMatch(/failed/);
|
735
|
-
expect(failure.getAttribute("class")).toMatch(/spec-detail/);
|
870
|
+
expect(failure.getAttribute("class")).toMatch(/jasmine-failed/);
|
871
|
+
expect(failure.getAttribute("class")).toMatch(/jasmine-spec-detail/);
|
736
872
|
|
737
873
|
var specDiv = failure.childNodes[0];
|
738
|
-
expect(specDiv.getAttribute("class")).toEqual("description");
|
874
|
+
expect(specDiv.getAttribute("class")).toEqual("jasmine-description");
|
739
875
|
|
740
876
|
var specLink = specDiv.childNodes[0];
|
741
877
|
expect(specLink.getAttribute("title")).toEqual("a suite with a failing spec");
|
742
878
|
expect(specLink.getAttribute("href")).toEqual("?foo=bar&spec=a suite with a failing spec");
|
743
879
|
|
744
880
|
var message = failure.childNodes[1].childNodes[0];
|
745
|
-
expect(message.getAttribute("class")).toEqual("result-message");
|
881
|
+
expect(message.getAttribute("class")).toEqual("jasmine-result-message");
|
746
882
|
expect(message.innerHTML).toEqual("a failure message");
|
747
883
|
|
748
884
|
var stackTrace = failure.childNodes[1].childNodes[1];
|
749
|
-
expect(stackTrace.getAttribute("class")).toEqual("stack-trace");
|
885
|
+
expect(stackTrace.getAttribute("class")).toEqual("jasmine-stack-trace");
|
750
886
|
expect(stackTrace.innerHTML).toEqual("a stack trace");
|
751
887
|
});
|
752
888
|
|
753
889
|
it("allows switching between failure details and the spec summary", function() {
|
754
|
-
var menuBar = container.querySelectorAll(".bar")[1];
|
890
|
+
var menuBar = container.querySelectorAll(".jasmine-bar")[1];
|
755
891
|
|
756
892
|
expect(menuBar.getAttribute("class")).not.toMatch(/hidden/);
|
757
893
|
|
@@ -762,7 +898,7 @@ describe("New HtmlReporter", function() {
|
|
762
898
|
|
763
899
|
it("sets the reporter to 'Failures List' mode", function() {
|
764
900
|
var reporterNode = container.querySelector(".jasmine_html-reporter");
|
765
|
-
expect(reporterNode.getAttribute("class")).toMatch("failure-list");
|
901
|
+
expect(reporterNode.getAttribute("class")).toMatch("jasmine-failure-list");
|
766
902
|
});
|
767
903
|
});
|
768
904
|
});
|