mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-13 17:30:27 -07:00
Update test logic to display all test errors
This commit is contained in:
parent
71c4e2de2f
commit
33f2e337dd
1 changed files with 11 additions and 5 deletions
|
|
@ -16,8 +16,10 @@ const stackLog = (err) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const run = async (tests) => {
|
const run = async (tests) => {
|
||||||
try {
|
let errorsEncountered = false;
|
||||||
for (let i = 0; i < tests.length; i += 1) {
|
|
||||||
|
for (let i = 0; i < tests.length; i += 1) {
|
||||||
|
try {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(`[${os.platform()}] ${scriptName}: test ${i}`);
|
console.log(`[${os.platform()}] ${scriptName}: test ${i}`);
|
||||||
const test = tests[i];
|
const test = tests[i];
|
||||||
|
|
@ -69,10 +71,14 @@ const run = async (tests) => {
|
||||||
chai.assert.deepEqual(testOutput, expectedOutput);
|
chai.assert.deepEqual(testOutput, expectedOutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
stackLog(err);
|
||||||
|
errorsEncountered = true;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
}
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
stackLog(err);
|
if (errorsEncountered) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue