Retry flow tests in script mode only if it is supposed to succeed

This commit is contained in:
Brian Ng
2018-04-26 09:31:20 -05:00
parent 87ae286bc3
commit 7c4509e280
2 changed files with 11 additions and 17 deletions

View File

@@ -173,15 +173,18 @@ tests.forEach(section => {
} catch (e) {
exception = e;
failed = true;
// lets retry in script mode
try {
parse(
test.content,
Object.assign({}, babylonOptions, { sourceType: "script" })
);
exception = null;
failed = false;
} catch (e) {}
if (shouldSuccess) {
try {
parse(
test.content,
Object.assign({}, babylonOptions, { sourceType: "script" })
);
exception = null;
failed = false;
} catch (e) {}
}
}
const isSuccess = shouldSuccess !== failed;