Handle case when expected error and receives none
parent
3d89881373
commit
04df7a51d2
|
@ -74,7 +74,14 @@
|
|||
].join("\n");
|
||||
}
|
||||
} else {
|
||||
if (result.result === test.expectedOutput) {
|
||||
if (test.expectedError) {
|
||||
test.status = "failing";
|
||||
test.output = [
|
||||
"Failing",
|
||||
"-------",
|
||||
"Expected an error but did not receive one.",
|
||||
].join("\n");
|
||||
} else if (result.result === test.expectedOutput) {
|
||||
test.status = "passing";
|
||||
} else {
|
||||
test.status = "failing";
|
||||
|
|
|
@ -21,6 +21,17 @@ TestRegister.addTests([
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Example non-error when error was expected",
|
||||
input: "1",
|
||||
expectedError: true,
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "To Base",
|
||||
args: [16],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Example fail",
|
||||
input: "1\n2\na\n4",
|
||||
|
|
Loading…
Reference in New Issue