Skip to content

Commit 03ec293

Browse files
committedNov 27, 2021
Merge branch 'main' into 3.99
2 parents a7d18ff + 30e2eee commit 03ec293

File tree

5 files changed

+77
-9
lines changed

5 files changed

+77
-9
lines changed
 

‎lib/jasmine.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,11 @@ Jasmine.prototype.execute = async function(files, filterString) {
583583

584584
await this.loadSpecs();
585585

586-
this.addReporter(this.completionReporter);
586+
if (!this.completionReporterInstalled_) {
587+
this.addReporter(this.completionReporter);
588+
this.completionReporterInstalled_ = true;
589+
}
590+
587591
let overallResult;
588592
this.addReporter({
589593
jasmineDone: r => overallResult = r

‎lib/reporters/console_reporter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function ConsoleReporter() {
9393
}
9494

9595
if (result && result.failedExpectations && result.failedExpectations.length > 0) {
96-
suiteFailureDetails(result);
96+
suiteFailureDetails({ fullName: 'top suite', ...result });
9797
}
9898

9999
if (pendingSpecs.length > 0) {

‎release_notes/3.10.0.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Jasmine NPM 3.10 Release Notes
2+
3+
This release updates the jasmine-core dependency to 3.10.0. See the
4+
[jasmine-core release notes](https://github.com/pivotal/jasmine/blob/main/release_notes/3.10.0.md)
5+
for more information.
6+
7+
## New features and bugfixes
8+
9+
* Support for executing the suite multiple times
10+
* See the jasmine-core release notes for details
11+
12+
* Display the top suite name as "top suite", not "undefined" when reporting
13+
suite-level failures
14+
15+
* Fixed reporting of load-time errors from modules imported by specs
16+
17+
* Made the promise returned from `Jasmine#execute` usable
18+
* Added an exitOnCompletion property to directly control whether Jasmine
19+
should make the Node process exit. Previously this could only be done by
20+
calling `Jasmine#onComplete`.
21+
* The promise returned from `Jasmine#execute` is resolved to the overall
22+
status.
23+
24+
* Improved interface for programmatically adding files
25+
* Added Jasmine#addHelperFile
26+
* Added more clearly named synonyms for Jasmine#addSpecFiles and
27+
Jasmine#addHelperFiles, and marked the old ones deprecated
28+
29+
30+
## Documentation improvements
31+
32+
* Added jsdoc for `Jasmine#env`
33+
34+
35+
## Internal updates
36+
37+
* Pass stopOnSpecFailure and stopSpecOnExpectationFailure options to core,
38+
not the deprecated failFast and oneFailurePerSpec options
39+
40+
* Replaced var with const and let
41+
42+
* Test suite improvements
43+
44+
## Supported environments
45+
46+
The jasmine NPM package has been tested on Node 12, 14, and 16. See the
47+
[jasmine-core release notes](https://github.com/jasmine/jasmine/blob/main/release_notes/3.10.0.md)
48+
for supported browsers.
49+
50+
------
51+
52+
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_

‎spec/jasmine_spec.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ describe('Jasmine', function() {
570570
expect(this.testJasmine.env.configure).toHaveBeenCalledWith({specFilter: jasmine.any(Function)});
571571
});
572572

573-
it('adds an exit code reporter', async function() {
573+
it('adds an exit code reporter the first time execute is called', async function() {
574574
const completionReporterSpy = jasmine.createSpyObj('reporter', ['onComplete']);
575575
this.testJasmine.completionReporter = completionReporterSpy;
576576
spyOn(this.testJasmine, 'addReporter');
@@ -579,6 +579,12 @@ describe('Jasmine', function() {
579579

580580
expect(this.testJasmine.addReporter).toHaveBeenCalledWith(completionReporterSpy);
581581
expect(this.testJasmine.completionReporter.exitHandler).toBe(this.testJasmine.checkExit);
582+
this.testJasmine.addReporter.calls.reset();
583+
584+
await this.testJasmine.execute();
585+
expect(this.testJasmine.addReporter).not.toHaveBeenCalledWith(
586+
completionReporterSpy
587+
);
582588
});
583589

584590
describe('when exit is called prematurely', function() {

‎spec/reporters/console_reporter_spec.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -551,16 +551,22 @@ describe("ConsoleReporter", function() {
551551
const reporter = new ConsoleReporter();
552552
reporter.setOptions({
553553
print: this.out.print,
554-
showColors: true
554+
showColors: false
555555
});
556556

557-
reporter.suiteDone({ failedExpectations: [{ message: 'After All Exception' }] });
558-
reporter.suiteDone({ failedExpectations: [{ message: 'Some Other Exception' }] });
557+
reporter.suiteDone({
558+
fullName: 'suite 1',
559+
failedExpectations: [{ message: 'After All Exception' }]
560+
});
561+
reporter.suiteDone({
562+
fullName: 'suite 2',
563+
failedExpectations: [{ message: 'Some Other Exception' }]
564+
});
559565
reporter.jasmineDone({ failedExpectations: [{ message: 'Global Exception' }] });
560566

561-
expect(this.out.getOutput()).toMatch(/After All Exception/);
562-
expect(this.out.getOutput()).toMatch(/Some Other Exception/);
563-
expect(this.out.getOutput()).toMatch(/Global Exception/);
567+
expect(this.out.getOutput()).toMatch(/Suite error: suite 1\s+Message:\s+After All Exception/);
568+
expect(this.out.getOutput()).toMatch(/Suite error: suite 2\s+Message:\s+Some Other Exception/);
569+
expect(this.out.getOutput()).toMatch(/Suite error: top suite\s+Message:\s+Global Exception/);
564570
});
565571

566572
describe("with color", function() {

0 commit comments

Comments
 (0)
Please sign in to comment.