You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert... statements perform type narrowing, which allows Deno to infer types later in the code and suppress warnings. For example, the code below correctly doesn't trigger any warnings
expect matchers should narrow types. The example above should also not generate a warning about s possibly being undefined.
Describe alternatives you've considered
One could use assert... statements, but others may prefer (or inherit) the BDD syntax. Implementing type narrowing for expect would also give Deno linting an advantage over Jest + TypeScript, which doesn't and probably won't ever do this.
The text was updated successfully, but these errors were encountered:
assert...
statements perform type narrowing, which allows Deno to infer types later in the code and suppress warnings. For example, the code below correctly doesn't trigger any warningsexpect
on the other hand doesn't seem to convey type information downstream:Describe the solution you'd like
expect
matchers should narrow types. The example above should also not generate a warning abouts
possibly being undefined.Describe alternatives you've considered
One could use
assert...
statements, but others may prefer (or inherit) the BDD syntax. Implementing type narrowing forexpect
would also give Deno linting an advantage over Jest + TypeScript, which doesn't and probably won't ever do this.The text was updated successfully, but these errors were encountered: