The contains will partial match against the error message text (e.g. contains()).
We need a separate API for inflight and preflight because if this is an inflight closure it
is implicitly asynchronous, so it cannot be called preflight.
Example:
bring expect;
// this is the preflight version
expect.throws(() => { throw "my"; }); // `contains` is optional
test "an error is thrown" {
// this is the inflight version
expect.throws(() => {
throw "i am an error";
}, contains: "error");
}
Implementation Notes
No response
Component
No response
Community Notes
Please vote by adding a π reaction to the issue to help us prioritize.
If you are interested to work on this issue, please leave a comment.
If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Slack.
Use Case
Expect that a code block throws an error.
Proposed Solution
Proposed API:
The
contains
will partial match against the error message text (e.g.contains()
).Example:
Implementation Notes
No response
Component
No response
Community Notes