@@ -65,14 +65,14 @@ This can be useful if you have a unit test that mocks API calls and you need to
65
65
wait for your mock promises to all resolve .
66
66
67
67
If you return a promise in the ` waitFor ` callback (either explicitly or
68
- implicitly with ` async ` syntax ), then the ` waitFor ` utility will not call your
69
- callback again until that promise rejects . This allows you to ` waitFor ` things
70
- that must be checked asynchronously .
68
+ implicitly with the ` async ` syntax ), then the ` waitFor ` utility does not call
69
+ your callback again until that promise rejects . This allows you to ` waitFor `
70
+ things that must be checked asynchronously .
71
71
72
72
The default ` container ` is the global ` document ` . Make sure the elements you
73
73
wait for are descendants of ` container ` .
74
74
75
- The default ` interval ` is ` 50ms ` . However it will run your callback immediately
75
+ The default ` interval ` is ` 50ms ` . However it runs your callback immediately
76
76
before starting the intervals .
77
77
78
78
The default ` timeout ` is ` 1000ms ` .
@@ -83,9 +83,9 @@ what caused the timeout.
83
83
84
84
The default ` mutationObserverOptions ` is
85
85
` {subtree: true, childList: true, attributes: true, characterData: true} ` which
86
- will detect additions and removals of child elements (including text nodes ) in
87
- the ` container ` and any of its descendants . It will also detect attribute
88
- changes . When any of those changes occur , it will re - run the callback .
86
+ detects additions and removals of child elements (including text nodes ) in the
87
+ ` container ` and any of its descendants . It also detects attribute changes . When
88
+ any of those changes occur , it re - runs the callback .
89
89
90
90
## ` waitForElementToBeRemoved `
91
91
@@ -125,8 +125,8 @@ el.parentElement.removeChild(el)
125
125
// logs 'Element no longer in DOM'
126
126
` ` `
127
127
128
- ` waitForElementToBeRemoved ` will throw an error if the first argument is ` null `
129
- or an empty array :
128
+ ` waitForElementToBeRemoved ` throws an error if the first argument is ` null ` or
129
+ an empty array :
130
130
131
131
` ` ` javascript
132
132
waitForElementToBeRemoved(null).catch(err => console.log(err))
0 commit comments