mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 01:36:08 -07:00
Add tests
This commit is contained in:
parent
ffe427e285
commit
89fe92a8cc
2 changed files with 145 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ const run = async (tests) => {
|
|||
testOutput = test.outputModify(testOutput);
|
||||
}
|
||||
|
||||
if (test.error && test.error.shouldThrow) {
|
||||
if (test?.error?.shouldThrow) {
|
||||
if (errorEncountered !== false) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(errorEncountered);
|
||||
|
|
@ -54,6 +54,8 @@ const run = async (tests) => {
|
|||
} else {
|
||||
throw new Error('Expected plugin error but none was thrown!');
|
||||
}
|
||||
} else if (!test?.error?.shouldThrow && errorEncountered !== false) {
|
||||
throw new Error(`Unexpected plugin error!${errorEncountered}`);
|
||||
} else {
|
||||
chai.assert.deepEqual(testOutput, expectedOutput);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue