Removed the failFast and oneFailurePerSpec config properties
This commit is contained in:
@@ -116,9 +116,7 @@ describe('Env', function() {
|
||||
var initialConfig = {
|
||||
random: true,
|
||||
seed: '123',
|
||||
failFast: true,
|
||||
failSpecWithNoExpectations: true,
|
||||
oneFailurePerSpec: true,
|
||||
stopSpecOnExpectationFailure: true,
|
||||
stopOnSpecFailure: true,
|
||||
hideDisabled: true
|
||||
@@ -128,9 +126,7 @@ describe('Env', function() {
|
||||
env.configure({
|
||||
random: undefined,
|
||||
seed: undefined,
|
||||
failFast: undefined,
|
||||
failSpecWithNoExpectations: undefined,
|
||||
oneFailurePerSpec: undefined,
|
||||
stopSpecOnExpectationFailure: undefined,
|
||||
stopOnSpecFailure: undefined,
|
||||
hideDisabled: undefined
|
||||
@@ -141,89 +137,6 @@ describe('Env', function() {
|
||||
);
|
||||
});
|
||||
|
||||
it('sets stopOnSpecFailure when failFast is set, and vice versa', function() {
|
||||
spyOn(env, 'deprecated');
|
||||
env.configure({ failFast: true });
|
||||
expect(env.configuration()).toEqual(
|
||||
jasmine.objectContaining({
|
||||
failFast: true,
|
||||
stopOnSpecFailure: true
|
||||
})
|
||||
);
|
||||
|
||||
env.configure({ stopOnSpecFailure: false });
|
||||
expect(env.configuration()).toEqual(
|
||||
jasmine.objectContaining({
|
||||
failFast: false,
|
||||
stopOnSpecFailure: false
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects a single call that sets stopOnSpecFailure and failFast to different values', function() {
|
||||
spyOn(env, 'deprecated');
|
||||
expect(function() {
|
||||
env.configure({ failFast: true, stopOnSpecFailure: false });
|
||||
}).toThrowError(
|
||||
'stopOnSpecFailure and failFast are aliases for each ' +
|
||||
"other. Don't set failFast if you also set stopOnSpecFailure."
|
||||
);
|
||||
});
|
||||
|
||||
it('deprecates the failFast config property', function() {
|
||||
spyOn(env, 'deprecated');
|
||||
env.configure({ failFast: true });
|
||||
expect(env.deprecated).toHaveBeenCalledWith(
|
||||
'The `failFast` config property is deprecated and will be removed in a ' +
|
||||
'future version of Jasmine. Please use `stopOnSpecFailure` instead.',
|
||||
{ ignoreRunnable: true }
|
||||
);
|
||||
});
|
||||
|
||||
it('sets stopSpecOnExpectationFailure when oneFailurePerSpec is set, and vice versa', function() {
|
||||
spyOn(env, 'deprecated');
|
||||
env.configure({ oneFailurePerSpec: true });
|
||||
expect(env.configuration()).toEqual(
|
||||
jasmine.objectContaining({
|
||||
oneFailurePerSpec: true,
|
||||
stopSpecOnExpectationFailure: true
|
||||
})
|
||||
);
|
||||
|
||||
env.configure({ stopSpecOnExpectationFailure: false });
|
||||
expect(env.configuration()).toEqual(
|
||||
jasmine.objectContaining({
|
||||
oneFailurePerSpec: false,
|
||||
stopSpecOnExpectationFailure: false
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('rejects a single call that sets stopSpecOnExpectationFailure and oneFailurePerSpec to different values', function() {
|
||||
spyOn(env, 'deprecated');
|
||||
expect(function() {
|
||||
env.configure({
|
||||
oneFailurePerSpec: true,
|
||||
stopSpecOnExpectationFailure: false
|
||||
});
|
||||
}).toThrowError(
|
||||
'stopSpecOnExpectationFailure and oneFailurePerSpec are ' +
|
||||
"aliases for each other. Don't set oneFailurePerSpec if you also set " +
|
||||
'stopSpecOnExpectationFailure.'
|
||||
);
|
||||
});
|
||||
|
||||
it('deprecates the oneFailurePerSpec config property', function() {
|
||||
spyOn(env, 'deprecated');
|
||||
env.configure({ oneFailurePerSpec: true });
|
||||
expect(env.deprecated).toHaveBeenCalledWith(
|
||||
'The `oneFailurePerSpec` config property is deprecated and will be ' +
|
||||
'removed in a future version of Jasmine. Please use ' +
|
||||
'`stopSpecOnExpectationFailure` instead.',
|
||||
{ ignoreRunnable: true }
|
||||
);
|
||||
});
|
||||
|
||||
describe('promise library', function() {
|
||||
it('can be configured without a custom library', function() {
|
||||
env.configure({});
|
||||
|
||||
@@ -886,7 +886,7 @@ describe('spec running', function() {
|
||||
});
|
||||
});
|
||||
|
||||
function behavesLikeStopOnSpecFailureIsOn(configureFn) {
|
||||
describe('when stopOnSpecFailure is on', function() {
|
||||
it('does not run further specs when one fails', function(done) {
|
||||
var actions = [],
|
||||
config;
|
||||
@@ -905,25 +905,12 @@ describe('spec running', function() {
|
||||
});
|
||||
|
||||
env.configure({ random: false });
|
||||
configureFn(env);
|
||||
env.configure({ stopOnSpecFailure: true });
|
||||
|
||||
env.execute(null, function() {
|
||||
expect(actions).toEqual(['fails']);
|
||||
done();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
describe('when failFast is on', function() {
|
||||
behavesLikeStopOnSpecFailureIsOn(function(env) {
|
||||
spyOn(env, 'deprecated');
|
||||
env.configure({ failFast: true });
|
||||
});
|
||||
});
|
||||
|
||||
describe('when stopOnSpecFailure is on', function() {
|
||||
behavesLikeStopOnSpecFailureIsOn(function(env) {
|
||||
env.configure({ stopOnSpecFailure: true });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -818,7 +818,10 @@ describe('HtmlReporter', function() {
|
||||
var stopOnFailureUI = container.querySelector('.jasmine-fail-fast');
|
||||
stopOnFailureUI.click();
|
||||
|
||||
expect(navigationHandler).toHaveBeenCalledWith('failFast', true);
|
||||
expect(navigationHandler).toHaveBeenCalledWith(
|
||||
'stopOnSpecFailure',
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
it('should navigate and turn the setting off', function() {
|
||||
@@ -847,7 +850,10 @@ describe('HtmlReporter', function() {
|
||||
var stopOnFailureUI = container.querySelector('.jasmine-fail-fast');
|
||||
stopOnFailureUI.click();
|
||||
|
||||
expect(navigationHandler).toHaveBeenCalledWith('failFast', false);
|
||||
expect(navigationHandler).toHaveBeenCalledWith(
|
||||
'stopOnSpecFailure',
|
||||
false
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -924,7 +930,10 @@ describe('HtmlReporter', function() {
|
||||
var throwingExpectationsUI = container.querySelector('.jasmine-throw');
|
||||
throwingExpectationsUI.click();
|
||||
|
||||
expect(navigateHandler).toHaveBeenCalledWith('oneFailurePerSpec', true);
|
||||
expect(navigateHandler).toHaveBeenCalledWith(
|
||||
'stopSpecOnExpectationFailure',
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
it('should navigate and change the setting to off', function() {
|
||||
@@ -954,7 +963,7 @@ describe('HtmlReporter', function() {
|
||||
throwingExpectationsUI.click();
|
||||
|
||||
expect(navigateHandler).toHaveBeenCalledWith(
|
||||
'oneFailurePerSpec',
|
||||
'stopSpecOnExpectationFailure',
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user