Commit a8341af
authored
test: wait for async process completion (#539)
`generateConfigs()` function executes a nodejs [exec] that takes many
seconds to complete. As the test was not waiting for the process to
terminate, Jest was complaining with the following error message:
```
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
```
Additionally, this test could have a false positive expectation since it
was likely to run the snapshot comparison with previously generated
plugin configurations.
By default Jest tests will timeout if they take longer than 5 seconds to
complete, since this test takes more than 10 seconds to complete on my
local machine, this test timeout configuration has been increased to 20
seconds.
[exec]: https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback1 parent f31dc61 commit a8341af
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
0 commit comments