Skip to content

Commit

Permalink
Update unit tests to account for change to avoid config deprecation w…
Browse files Browse the repository at this point in the history
…arnings.
  • Loading branch information
claudiosdc committed Nov 30, 2018
1 parent 48a72e7 commit 86a4a1a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions spec/jasmine_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ describe('Jasmine', function() {
execute: jasmine.createSpy('execute'),
throwOnExpectationFailure: jasmine.createSpy('throwOnExpectationFailure'),
stopOnSpecFailure: jasmine.createSpy('stopOnSpecFailure'),
randomizeTests: jasmine.createSpy('randomizeTests')
randomizeTests: jasmine.createSpy('randomizeTests'),
configure: jasmine.createSpy('configure')
}),
Timer: jasmine.createSpy('Timer')
};
Expand Down Expand Up @@ -191,39 +192,39 @@ describe('Jasmine', function() {
this.configObject.stopSpecOnExpectationFailure = true;
this.fixtureJasmine.loadConfig(this.configObject);

expect(this.fixtureJasmine.env.throwOnExpectationFailure).toHaveBeenCalledWith(true);
expect(this.fixtureJasmine.env.configure).toHaveBeenCalledWith({oneFailurePerSpec: true});
});

it('does not configure jasmine-core for stopping spec on expectation failure by default', function() {
this.fixtureJasmine.loadConfig(this.configObject);

expect(this.fixtureJasmine.env.throwOnExpectationFailure).not.toHaveBeenCalled();
expect(this.fixtureJasmine.env.configure).not.toHaveBeenCalled();
});

it('can tell jasmine-core to stop execution when a spec fails', function() {
this.configObject.stopOnSpecFailure = true;
this.fixtureJasmine.loadConfig(this.configObject);

expect(this.fixtureJasmine.env.stopOnSpecFailure).toHaveBeenCalledWith(true);
expect(this.fixtureJasmine.env.configure).toHaveBeenCalledWith({failFast: true});
});

it('does not configure jasmine-core for stopping execution by default', function() {
this.fixtureJasmine.loadConfig(this.configObject);

expect(this.fixtureJasmine.env.stopOnSpecFailure).not.toHaveBeenCalled();
expect(this.fixtureJasmine.env.configure).not.toHaveBeenCalled();
});

it('can tell jasmine-core to run random specs', function() {
this.configObject.random = true;
this.fixtureJasmine.loadConfig(this.configObject);

expect(this.fixtureJasmine.env.randomizeTests).toHaveBeenCalledWith(true);
expect(this.fixtureJasmine.env.configure).toHaveBeenCalledWith({random: true});
});

it('uses jasmine-core defaults if random is unspecified', function() {
this.fixtureJasmine.loadConfig(this.configObject);

expect(this.fixtureJasmine.env.randomizeTests).not.toHaveBeenCalled();
expect(this.fixtureJasmine.env.configure).not.toHaveBeenCalled();
});

describe('with options', function() {
Expand Down

0 comments on commit 86a4a1a

Please sign in to comment.