I tried passing the editor as the first parameter but it still doesn't work, I believe that the problem is that the passed editor hasn't been resolved yet, so when the run function from the check functions work, they will use the undefined editor. Anyway, since the test already calls any of the open editor functions (depending on the test made) and since the editor variable gets nulled after each test, it already decides which editor to use without having to explicitly passed as a parameter, and since everything is run inside the run function it should work synchronously.