We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
this
1 parent a566152 commit c589300Copy full SHA for c589300
index.js
@@ -23,11 +23,11 @@ function install(globalObject) {
23
24
function runPitTest(promiseBuilder) {
25
var jasmineEnv = jasmine.getEnv();
26
- var spec = this;
+ var spec = jasmineEnv.currentSpec;
27
var isFinished = false;
28
var error = null;
29
30
- jasmineEnv.currentSpec.runs(function() {
+ spec.runs(function() {
31
try {
32
var promise = promiseBuilder.call(spec);
33
if (!promise || !promise.then) {
@@ -45,8 +45,8 @@ function install(globalObject) {
45
}
46
});
47
48
- jasmineEnv.currentSpec.waitsFor(function() { return isFinished; });
49
- jasmineEnv.currentSpec.runs(function() { if (error) throw error; });
+ spec.waitsFor(function() { return isFinished; });
+ spec.runs(function() { if (error) throw error; });
50
};
51
52
0 commit comments