Also move function to determine whether specs should catch exceptions into closure

This commit is contained in:
Sheel Choksi
2013-10-24 16:24:55 -07:00
parent d9ece1f14f
commit 7a4876ecfa
2 changed files with 5 additions and 21 deletions

View File

@@ -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() {
it("throws the Pending Spec exception", function() {
expect(function() {
@@ -422,7 +407,6 @@ describe("Env integration", function() {
});
var suiteResult = reporter.suiteStarted.calls.first().args[0];
expect(suiteResult.description).toEqual("A Suite");
expect(reporter.jasmineDone).toHaveBeenCalled();
done();
});

View File

@@ -116,10 +116,6 @@ getJasmineRequireObj().Env = function(j$) {
return catchExceptions;
};
this.catchException = function(e) {
return j$.Spec.isPendingSpecException(e) || catchExceptions;
};
var maximumSpecCallbackDepth = 20;
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) {
options.catchException = self.catchException;
options.catchException = catchException;
options.clearStack = options.clearStack || clearStack;
new j$.QueueRunner(options).execute();