From b76d322fc8cdca8bf3d14457f470962272139c3e Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 2 Sep 2023 15:03:55 -0700 Subject: [PATCH] waitFor FAQ --- _faq/other-software/testing-library.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 _faq/other-software/testing-library.md diff --git a/_faq/other-software/testing-library.md b/_faq/other-software/testing-library.md new file mode 100644 index 0000000..7dfb9b8 --- /dev/null +++ b/_faq/other-software/testing-library.md @@ -0,0 +1,11 @@ +--- +question: How can I use Jasmine matchers with testing-library's waitFor function? +--- + +Use `throwUnless` instead of `expect`: + +``` +await waitFor(function() { + throwUnless(myDialogElement).toHaveClass('open'); +}); +``` \ No newline at end of file