fix isInitRun flag not set
When doing jQuery challenges and starting with failing tests isInitRun, the flag that prevents initial run from auto submitting a challenge does not get set due to bonfireExecute not running in this situation. This fixes that by setting consitantly setting the flag on failing tests so that when tests do pass by camper the flag will always be set and allow the camper to continue. closes #2772
This commit is contained in:
@ -401,9 +401,13 @@ var postError = function(data) {
|
|||||||
var goodTests = 0;
|
var goodTests = 0;
|
||||||
var testSuccess = function() {
|
var testSuccess = function() {
|
||||||
goodTests++;
|
goodTests++;
|
||||||
|
// test successful run show completion
|
||||||
if (goodTests === tests.length) {
|
if (goodTests === tests.length) {
|
||||||
showCompletion();
|
return showCompletion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test unsuccessful, make sure initRun is set to false
|
||||||
|
isInitRun = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
function showCompletion() {
|
function showCompletion() {
|
||||||
@ -624,7 +628,9 @@ var runTests = function(err, data) {
|
|||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
if (chaiTestFromJSON) {
|
if (chaiTestFromJSON) {
|
||||||
|
/* eslint-disable no-eval */
|
||||||
var output = eval(reassembleTest(chaiTestFromJSON, data));
|
var output = eval(reassembleTest(chaiTestFromJSON, data));
|
||||||
|
/* eslint-enable no-eval */
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
allTestsPassed = false;
|
allTestsPassed = false;
|
||||||
@ -639,8 +645,7 @@ var runTests = function(err, data) {
|
|||||||
if (allTestsPassed) {
|
if (allTestsPassed) {
|
||||||
allTestsPassed = false;
|
allTestsPassed = false;
|
||||||
showCompletion();
|
showCompletion();
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
isInitRun = false;
|
isInitRun = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user