Skip to content

Commit 0488650

Browse files
committedMay 12, 2021
Added support for the verboseDeprecations config var
1 parent 641c33d commit 0488650

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
 

‎lib/jasmine.js

+4
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ Jasmine.prototype.loadConfig = function(config) {
140140
configuration.random = config.random;
141141
}
142142

143+
if (config.verboseDeprecations !== undefined) {
144+
configuration.verboseDeprecations = config.verboseDeprecations;
145+
}
146+
143147
if (config.jsLoader === 'import') {
144148
checkForJsFileImportSupport();
145149
this._alwaysImport = true;

‎spec/jasmine_spec.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,23 @@ describe('Jasmine', function() {
275275
});
276276
});
277277

278+
it('passes verboseDeprecations to jasmine-core when specified', function() {
279+
this.configObject.verboseDeprecations = true;
280+
this.fixtureJasmine.loadConfig(this.configObject);
281+
282+
expect(this.fixtureJasmine.env.configure).toHaveBeenCalledWith(
283+
jasmine.objectContaining({verboseDeprecations: true})
284+
);
285+
});
286+
287+
it('does not pass verboseDeprecations to jasmine-core when not specified', function() {
288+
this.configObject.random = true; // or set any other property
289+
this.fixtureJasmine.loadConfig(this.configObject);
290+
291+
expect(this.fixtureJasmine.env.configure).toHaveBeenCalled();
292+
expect(this.fixtureJasmine.env.configure.calls.argsFor(0)[0].verboseDeprecations)
293+
.toBeUndefined();
294+
});
278295
describe('with jsLoader: "require"', function () {
279296
it('tells the loader not to always import', async function() {
280297
this.configObject.jsLoader = 'require';
@@ -309,7 +326,7 @@ describe('Jasmine', function() {
309326
describe('with jsLoader undefined', function () {
310327
it('tells the loader not to always import', async function() {
311328
this.configObject.jsLoader = undefined;
312-
329+
313330
this.fixtureJasmine.loadConfig(this.configObject);
314331
await this.fixtureJasmine.loadSpecs();
315332

0 commit comments

Comments
 (0)
Please sign in to comment.