Also move function to determine whether specs should catch exceptions into closure
This commit is contained in:
@@ -84,21 +84,6 @@ describe("Env", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("#catchException", function() {
|
|
||||||
it("returns true if the exception is a pending spec exception", function() {
|
|
||||||
env.catchExceptions(false);
|
|
||||||
|
|
||||||
expect(env.catchException(new Error(j$.Spec.pendingSpecExceptionMessage))).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("returns false if the exception is not a pending spec exception and not catching exceptions", function() {
|
|
||||||
env.catchExceptions(false);
|
|
||||||
|
|
||||||
expect(env.catchException(new Error("external error"))).toBe(false);
|
|
||||||
expect(env.catchException(new Error(j$.Spec.pendingSpecExceptionMessage))).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("#pending", function() {
|
describe("#pending", function() {
|
||||||
it("throws the Pending Spec exception", function() {
|
it("throws the Pending Spec exception", function() {
|
||||||
expect(function() {
|
expect(function() {
|
||||||
@@ -422,7 +407,6 @@ describe("Env integration", function() {
|
|||||||
});
|
});
|
||||||
var suiteResult = reporter.suiteStarted.calls.first().args[0];
|
var suiteResult = reporter.suiteStarted.calls.first().args[0];
|
||||||
expect(suiteResult.description).toEqual("A Suite");
|
expect(suiteResult.description).toEqual("A Suite");
|
||||||
expect(reporter.jasmineDone).toHaveBeenCalled();
|
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -116,10 +116,6 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
return catchExceptions;
|
return catchExceptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.catchException = function(e) {
|
|
||||||
return j$.Spec.isPendingSpecException(e) || catchExceptions;
|
|
||||||
};
|
|
||||||
|
|
||||||
var maximumSpecCallbackDepth = 20;
|
var maximumSpecCallbackDepth = 20;
|
||||||
var currentSpecCallbackDepth = 0;
|
var currentSpecCallbackDepth = 0;
|
||||||
|
|
||||||
@@ -133,8 +129,12 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var catchException = function(e) {
|
||||||
|
return j$.Spec.isPendingSpecException(e) || catchExceptions;
|
||||||
|
};
|
||||||
|
|
||||||
var queueRunnerFactory = function(options) {
|
var queueRunnerFactory = function(options) {
|
||||||
options.catchException = self.catchException;
|
options.catchException = catchException;
|
||||||
options.clearStack = options.clearStack || clearStack;
|
options.clearStack = options.clearStack || clearStack;
|
||||||
|
|
||||||
new j$.QueueRunner(options).execute();
|
new j$.QueueRunner(options).execute();
|
||||||
|
|||||||
Reference in New Issue
Block a user