Skip to content

Commit

Permalink
Changes to avoid config deprecation warnings (from jasmine-core).
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiosdc committed Nov 30, 2018
1 parent 6c7db63 commit 48a72e7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,22 @@ Jasmine.prototype.loadConfigFile = function(configFilePath) {
Jasmine.prototype.loadConfig = function(config) {
this.specDir = config.spec_dir || this.specDir;

var configOptions = {};

if (config.stopSpecOnExpectationFailure !== undefined) {
this.env.throwOnExpectationFailure(config.stopSpecOnExpectationFailure);
configOptions.oneFailurePerSpec = config.stopSpecOnExpectationFailure;
}

if (config.stopOnSpecFailure !== undefined) {
this.env.stopOnSpecFailure(config.stopOnSpecFailure);
configOptions.failFast = config.stopOnSpecFailure;
}

if (config.random !== undefined) {
this.env.randomizeTests(config.random);
configOptions.random = config.random;
}

if (Object.keys(configOptions).length > 0) {
this.env.configure(configOptions);
}

if(config.helpers) {
Expand Down

0 comments on commit 48a72e7

Please sign in to comment.