Skip to content

Commit 607e95a

Browse files
authored
Merge pull request #321 from gruntjs/fix-300
moved resolveJasmine/jasminePromise function to fix scope issue
2 parents f4d996b + 444aa37 commit 607e95a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tasks/jasmine.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ module.exports = function(grunt) {
2727

2828
var status = {};
2929

30-
let resolveJasmine;
31-
const jasminePromise = new Promise((resolve) => {
32-
resolveJasmine = resolve;
33-
});
34-
3530
var symbols = {
3631
none: {
3732
check: '',
@@ -166,8 +161,14 @@ module.exports = function(grunt) {
166161
grunt.log.subhead(`Testing specs with Jasmine/${options.version} via ${await browser.version()}`);
167162
const page = await browser.newPage();
168163

164+
165+
let resolveJasmine;
166+
const jasminePromise = new Promise((resolve) => {
167+
resolveJasmine = resolve;
168+
});
169+
169170
try {
170-
await setup(options, dispatcher, page);
171+
await setup(options, dispatcher, page, resolveJasmine);
171172
await page.goto(file, { waitUntil: 'domcontentloaded' });
172173

173174
await jasminePromise;
@@ -194,7 +195,7 @@ module.exports = function(grunt) {
194195
}
195196
}
196197

197-
async function setup(options, dispatcher, page) {
198+
async function setup(options, dispatcher, page, resolveJasmine) {
198199
var indentLevel = 1,
199200
tabstop = 2,
200201
thisRun = {},

0 commit comments

Comments
 (0)