mirror of
https://github.com/gchq/CyberChef
synced 2024-11-15 00:57:08 +00:00
Handle case when expected error and receives none
This commit is contained in:
parent
3d89881373
commit
04df7a51d2
2 changed files with 19 additions and 1 deletions
|
@ -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 a new issue