Removed expect/expectAsync indirection through spec/suite
This commit is contained in:
@@ -809,14 +809,6 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
this.result.properties[key] = value;
|
this.result.properties[key] = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
Spec.prototype.expect = function(actual) {
|
|
||||||
return this.expectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Spec.prototype.expectAsync = function(actual) {
|
|
||||||
return this.asyncExpectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Spec.prototype.execute = function(
|
Spec.prototype.execute = function(
|
||||||
queueRunnerFactory,
|
queueRunnerFactory,
|
||||||
onComplete,
|
onComplete,
|
||||||
@@ -1904,23 +1896,27 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.expect = function(actual) {
|
this.expect = function(actual) {
|
||||||
if (!runner.currentRunable()) {
|
const runable = runner.currentRunable();
|
||||||
|
|
||||||
|
if (!runable) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"'expect' was used when there was no current spec, this could be because an asynchronous test timed out"
|
"'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) {
|
this.expectAsync = function(actual) {
|
||||||
if (!runner.currentRunable()) {
|
const runable = runner.currentRunable();
|
||||||
|
|
||||||
|
if (!runable) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"'expectAsync' was used when there was no current spec, this could be because an asynchronous test timed out"
|
"'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) {
|
this.beforeEach = function(beforeEachFunction, timeout) {
|
||||||
@@ -9755,14 +9751,6 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
this.result.properties[key] = value;
|
this.result.properties[key] = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
Suite.prototype.expect = function(actual) {
|
|
||||||
return this.expectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Suite.prototype.expectAsync = function(actual) {
|
|
||||||
return this.asyncExpectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Suite.prototype.getFullName = function() {
|
Suite.prototype.getFullName = function() {
|
||||||
const fullName = [];
|
const fullName = [];
|
||||||
for (
|
for (
|
||||||
|
|||||||
@@ -767,23 +767,27 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.expect = function(actual) {
|
this.expect = function(actual) {
|
||||||
if (!runner.currentRunable()) {
|
const runable = runner.currentRunable();
|
||||||
|
|
||||||
|
if (!runable) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"'expect' was used when there was no current spec, this could be because an asynchronous test timed out"
|
"'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) {
|
this.expectAsync = function(actual) {
|
||||||
if (!runner.currentRunable()) {
|
const runable = runner.currentRunable();
|
||||||
|
|
||||||
|
if (!runable) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"'expectAsync' was used when there was no current spec, this could be because an asynchronous test timed out"
|
"'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) {
|
this.beforeEach = function(beforeEachFunction, timeout) {
|
||||||
|
|||||||
@@ -70,14 +70,6 @@ getJasmineRequireObj().Spec = function(j$) {
|
|||||||
this.result.properties[key] = value;
|
this.result.properties[key] = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
Spec.prototype.expect = function(actual) {
|
|
||||||
return this.expectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Spec.prototype.expectAsync = function(actual) {
|
|
||||||
return this.asyncExpectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Spec.prototype.execute = function(
|
Spec.prototype.execute = function(
|
||||||
queueRunnerFactory,
|
queueRunnerFactory,
|
||||||
onComplete,
|
onComplete,
|
||||||
|
|||||||
@@ -28,14 +28,6 @@ getJasmineRequireObj().Suite = function(j$) {
|
|||||||
this.result.properties[key] = value;
|
this.result.properties[key] = value;
|
||||||
};
|
};
|
||||||
|
|
||||||
Suite.prototype.expect = function(actual) {
|
|
||||||
return this.expectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Suite.prototype.expectAsync = function(actual) {
|
|
||||||
return this.asyncExpectationFactory(actual, this);
|
|
||||||
};
|
|
||||||
|
|
||||||
Suite.prototype.getFullName = function() {
|
Suite.prototype.getFullName = function() {
|
||||||
const fullName = [];
|
const fullName = [];
|
||||||
for (
|
for (
|
||||||
|
|||||||
Reference in New Issue
Block a user