In plugin tests, there're many chances to test modules with ScriptableFuture results. Until now, we've used async tests with it.will, but it's been rapidly getting verbose and complicated. While adding tests for ScriptableCollection, I finally found that wait was really needed, at least for tests.
I once thought to add it as a method of ScriptableFuture, but I think it's better not to enable user to use wait, as they could use it in the production level which is a bad practice. Thus I added it as a test-helper module.
The first commit is to add the helper module, and the other is to modify the original tests to use the helper.
In plugin tests, there're many chances to test modules with ScriptableFuture results. Until now, we've used async tests with
it.will
, but it's been rapidly getting verbose and complicated. While adding tests forScriptableCollection
, I finally found thatwait
was really needed, at least for tests.I once thought to add it as a method of
ScriptableFuture
, but I think it's better not to enable user to usewait
, as they could use it in the production level which is a bad practice. Thus I added it as atest-helper
module.The first commit is to add the helper module, and the other is to modify the original tests to use the helper.