mirror of
https://github.com/gchq/CyberChef
synced 2025-12-11 13:53:26 +00:00
Make expectOutput actually check the output
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user