Skip to content

Commit

Permalink
test script only returns once per file
Browse files Browse the repository at this point in the history
rather than once per file per test method
  • Loading branch information
Spappz committed Feb 13, 2024
1 parent caf74c6 commit b6808e2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ for (const file of files) {
});
}
}
opts.test.forEach((method) => {
const testResult = methods[method][opts.bundle ? "bundle" : "data"](testJSON);
if (testResult.success) {
if (!opts.error && !opts.summary) console.log(chalk.dim(passed + file));
} else {
console.log(failed + file);
if (!opts.all) {
throw testResult.error;
}
failCount++;
const validationFailure = opts.test
.map((method) => methods[method][opts.bundle ? "bundle" : "data"](testJSON))
.find((result) => !result.success);
if (validationFailure) {
console.log(failed + file);
if (!opts.all) {
throw validationFailure.error;
}
});
failCount++;
} else {
if (!opts.error && !opts.summary) console.log(chalk.dim(passed + file));
}
}

// Summarise
Expand Down

0 comments on commit b6808e2

Please sign in to comment.