Removed expect/expectAsync indirection through spec/suite

This commit is contained in:
Steve Gravrock
2023-06-21 19:23:54 -07:00
parent f8e4ea868f
commit 59600a1c29
4 changed files with 16 additions and 40 deletions

View File

@@ -767,23 +767,27 @@ getJasmineRequireObj().Env = function(j$) {
};
this.expect = function(actual) {
if (!runner.currentRunable()) {
const runable = runner.currentRunable();
if (!runable) {
throw new Error(
"'expect' was used when there was no current spec, this could be because an asynchronous test timed out"
);
}
return runner.currentRunable().expect(actual);
return runable.expectationFactory(actual, runable);
};
this.expectAsync = function(actual) {
if (!runner.currentRunable()) {
const runable = runner.currentRunable();
if (!runable) {
throw new Error(
"'expectAsync' was used when there was no current spec, this could be because an asynchronous test timed out"
);
}
return runner.currentRunable().expectAsync(actual);
return runable.asyncExpectationFactory(actual, runable);
};
this.beforeEach = function(beforeEachFunction, timeout) {