You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use rescript-test with inline_test_ppx and am running into some difficulty. inline_test_ppx outputs files as lib/bs/__inline_test.*.mjs. This seems to cause two problems, first it trips up the path logic in rescript-test resulting in
Unfortunately there is another issue, rescript-test always reports 0 tests even though it's picking up the correct files. This appears to be due to inline_test_ppx using an async require of the target file. For example, the lib/bs/__inline_test.mymodule.mjs will contain something like
import("../../src/mymodule.mjs").catch((e) => {
if (e.code !== "ERR_MODULE_NOT_FOUND") reject(e)
})
This causes rescript-test to always find 0 tests to run. If I manually change it to a synchronous import like so
import "../../src/mymodule.mjs"
then the tests are found and everything works correctly. I'm not quite sure why rescript-test isn't working with that async import style.
The text was updated successfully, but these errors were encountered:
For the second point, ReScript Test waits to modules to be imported, computes the tests to execute then runs them in sequence. This is by design to avoid having missed tests. The way the code is generated here seems to indicate there's no way to indicate to the runner that all the tests are ready, so even by adapting the binary, I'm not sure there's much we can do here.
I'm trying to use rescript-test with inline_test_ppx and am running into some difficulty. inline_test_ppx outputs files as
lib/bs/__inline_test.*.mjs
. This seems to cause two problems, first it trips up the path logic in rescript-test resulting inThis can be worked around by changing the path provided to retest
Unfortunately there is another issue, rescript-test always reports 0 tests even though it's picking up the correct files. This appears to be due to inline_test_ppx using an async require of the target file. For example, the
lib/bs/__inline_test.mymodule.mjs
will contain something likeThis causes rescript-test to always find 0 tests to run. If I manually change it to a synchronous import like so
then the tests are found and everything works correctly. I'm not quite sure why rescript-test isn't working with that async import style.
The text was updated successfully, but these errors were encountered: