refactor: rewrite waitFor tests
#1863
+356
−294
Merged
waitFor tests
#1863