Make expectOutput actually check the output

This commit is contained in:
zb3 2024-04-05 17:13:05 +02:00
parent ab0493f53a
commit 0f0efefbf7

View file

@ -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