Added throwUnless and throwUnlessAsync
These are similar to `expect` and `expectAsync` except that they throw exceptions rather than recording matcher failures as spec/suite failures. They're intended to support using Jasmine matchers in testing-library's `waitFor`, and also provide a way to integration-test custom matchers. These funtions are not equivalent to `expect` and `expectAsync` and should not be used in situations where you want a matcher failure to reliably fail the spec. Whether that happens depends on the structure of the surrounding code. In general, you should only use `throwUnless` when you expect something (which could be your own code or library code like `waitFor`) to catch the resulting exception. Fixes #2003. Fixes #1980.
This commit is contained in:
@@ -97,7 +97,8 @@
|
||||
],
|
||||
"space-before-blocks": "error",
|
||||
"no-eval": "error",
|
||||
"no-var": "error"
|
||||
"no-var": "error",
|
||||
"no-debugger": "error"
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
|
||||
Reference in New Issue
Block a user