avajs/bucklescript

Questions around AVA's CLI, configuration, and this package

Opened this issue · 4 comments

I'm still a bit confused around how this package should be used. Is there any configuration needed of AVA itself? How should AVA be invoked? Will npx ava (AVA's own CLI) suffice? Do we need a separate CLI command?

I thought that we need to manually compile these test files before running tests (BuckleScript does not have a register hook). By default bsb will emit files alongside their original Reason or OCaml source code, so if the source code of test index.test.re is present in the test directory, index.test.js will be emitted inside the test directory. Then after compilation, AVA will be able to recognize the JS file and run the tests correctly.

The full step of this may look like:

  • Install ava and @ava/bucklescript
  • Add @ava/bucklescript to bs-dev-dependencies in the bsconfig.json
{
  "bs-dev-dependencies": ["@ava/bucklescript"]
}
  • Write tests in Reason or OCaml
  • Compile source codes by BuckleScript
  • Run AVA by npx ava

@KsRyY are you using Reason / OCaml with AVA? We don't have anybody active who is, which is why this has languished.

I'm planning to move some of my projects to ReasonML, so I found this. I used to use AVA a lot in my projects.

If you're interested in helping out please let me know. Happy to give you commit access.