Skip to content

Commit ab76298

Browse files
committed
Update Jasmine to version 6.0.0
It fixes #20715. `failedExpectations` was removed from `suiteStarted` and `specStarted` events. HtmlReporter and HtmlSpecFilter have been deprecated and removed.
1 parent 176e085 commit ab76298

7 files changed

Lines changed: 55 additions & 142 deletions

File tree

package-lock.json

Lines changed: 41 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"istanbul-lib-coverage": "^3.2.2",
4242
"istanbul-lib-report": "^3.0.1",
4343
"istanbul-reports": "^3.2.0",
44-
"jasmine": "^5.13.0",
44+
"jasmine": "^6.1.0",
4545
"jsdoc": "^4.0.5",
4646
"jstransformer-nunjucks": "^1.2.0",
4747
"metalsmith": "^2.7.0",

test/font/font_os2_spec.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/font/jasmine-boot.js

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -66,70 +66,20 @@ async function initializePDFJS(callback) {
6666
extend(window, jasmineInterface);
6767

6868
// Runner Parameters
69-
const queryString = new jasmine.QueryString({
70-
getWindowLocation() {
71-
return window.location;
72-
},
73-
});
74-
75-
const config = {
76-
failFast: queryString.getParam("failFast"),
77-
oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"),
78-
hideDisabled: queryString.getParam("hideDisabled"),
79-
};
80-
81-
const random = queryString.getParam("random");
82-
if (random !== undefined && random !== "") {
83-
config.random = random;
84-
}
69+
const urls = new jasmine.HtmlReporterV2Urls();
8570

86-
const seed = queryString.getParam("seed");
87-
if (seed) {
88-
config.seed = seed;
89-
}
71+
env.configure(urls.configFromCurrentUrl());
9072

9173
// Reporters
92-
const htmlReporter = new jasmine.HtmlReporter({
93-
env,
94-
navigateWithNewParam(key, value) {
95-
return queryString.navigateWithNewParam(key, value);
96-
},
97-
addToExistingQueryString(key, value) {
98-
return queryString.fullStringWithNewParam(key, value);
99-
},
100-
getContainer() {
101-
return document.body;
102-
},
103-
createElement() {
104-
return document.createElement(...arguments);
105-
},
106-
createTextNode() {
107-
return document.createTextNode(...arguments);
108-
},
109-
timer: new jasmine.Timer(),
110-
});
74+
const htmlReporter = new jasmine.HtmlReporterV2({ env, urls });
11175

11276
env.addReporter(htmlReporter);
11377

114-
if (queryString.getParam("browser")) {
115-
const testReporter = new TestReporter(queryString.getParam("browser"));
78+
if (urls.queryString.getParam("browser")) {
79+
const testReporter = new TestReporter(urls.queryString.getParam("browser"));
11680
env.addReporter(testReporter);
11781
}
11882

119-
// Filter which specs will be run by matching the start of the full name
120-
// against the `spec` query param.
121-
const specFilter = new jasmine.HtmlSpecFilter({
122-
filterString() {
123-
return queryString.getParam("spec");
124-
},
125-
});
126-
127-
config.specFilter = function (spec) {
128-
return specFilter.matches(spec.getFullName());
129-
};
130-
131-
env.configure(config);
132-
13383
// Sets longer timeout.
13484
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
13585

@@ -142,7 +92,6 @@ async function initializePDFJS(callback) {
14292

14393
function fontTestInit() {
14494
initializePDFJS(function () {
145-
htmlReporter.initialize();
14695
env.execute();
14796
});
14897
}

test/integration/jasmine-boot.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@ async function runTests(results) {
6969
console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`);
7070
}
7171
},
72-
suiteStarted(result) {
73-
// Report on the result of `beforeAll` invocations.
74-
if (result.failedExpectations.length > 0) {
75-
++results.failures;
76-
console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`);
77-
}
78-
},
72+
suiteStarted(result) {},
7973
});
8074

8175
return jasmine.execute();

test/reporter.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,7 @@ const TestReporter = function (browser) {
5757
sendInfo(`Started ${total} tests for ${browser} with seed ${seed}.`);
5858
};
5959

60-
this.suiteStarted = function (result) {
61-
// Report on the result of `beforeAll` invocations.
62-
if (result.failedExpectations.length > 0) {
63-
let failedMessages = "";
64-
for (const item of result.failedExpectations) {
65-
failedMessages += `${item.message} `;
66-
}
67-
sendResult("TEST-UNEXPECTED-FAIL", result.description, failedMessages);
68-
}
69-
};
60+
this.suiteStarted = function (result) {};
7061

7162
this.specStarted = function (result) {};
7263

0 commit comments

Comments
 (0)