mirror of
https://github.com/gchq/CyberChef
synced 2024-12-29 14:03:10 +00:00
Make expectOutput actually check the output
This commit is contained in:
parent
ab0493f53a
commit
0f0efefbf7
1 changed files with 5 additions and 4 deletions
|
@ -176,13 +176,14 @@ function loadRecipe(browser, opName, input, args) {
|
||||||
*/
|
*/
|
||||||
function expectOutput(browser, expected) {
|
function expectOutput(browser, expected) {
|
||||||
browser.execute(expected => {
|
browser.execute(expected => {
|
||||||
const output = window.app.manager.output.outputEditorView.state.doc.toString();
|
return window.app.manager.output.outputEditorView.state.doc.toString();
|
||||||
|
}, [expected], function({value}) {
|
||||||
if (expected instanceof RegExp) {
|
if (expected instanceof RegExp) {
|
||||||
return expected.test(output);
|
browser.expect(value).match(expected);
|
||||||
} else {
|
} else {
|
||||||
return expected === output;
|
browser.expect(value).to.be.equal(expected);
|
||||||
}
|
}
|
||||||
}, [expected]);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @function
|
/** @function
|
||||||
|
|
Loading…
Reference in a new issue