Skip to content

Commit

Permalink
Make expectOutput actually check the output
Browse files Browse the repository at this point in the history
  • Loading branch information
zb3 committed Apr 5, 2024
1 parent ab0493f commit 0f0efef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/browser/browserUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,14 @@ function loadRecipe(browser, opName, input, args) {
*/
function expectOutput(browser, 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) {
return expected.test(output);
browser.expect(value).match(expected);
} else {
return expected === output;
browser.expect(value).to.be.equal(expected);
}
}, [expected]);
});
}

/** @function
Expand Down

0 comments on commit 0f0efef

Please sign in to comment.