[ANN] Alcotest 1.5.0

I’m pleased to announce the release of Alcotest 1.5.0, now available on Opam.

This release includes:

  • JavaScript compatibility (#326), via js_of_ocaml.3.11.0. Projects that build with js_of_ocaml can now use the regular alcotest package to test their JavaScript-compatible libraries. For users of dune, this is as easy as adding (modes ... js) to your test stanzas (to build the JavaScript targets) and a corresponding rule to run the output:

     (name main)
     (modes native js)
     (libraries alcotest))
     (alias runtest-js)
      (run node %{dep:main.bc.js})))

    To depend on a version of js_of_ocaml that is supported by Alcotest, add a dependency on the the virtual package alcotest-js.

    Many thanks @hhugo and @smorimoto for this excellent contribution!

  • Backtrace collection by default (#317). The Alcotest runner now enables backtrace collection by default, ensuring that failing native tests always come with backtraces without any need to set OCAMLRUNPARAM=b.

  • A stable Alcotest.V1 module (#306). This module is very similar to the existing top-level Alcotest module, but provides some stability guarantee across major versions. It’s intended to provide a migration path for an eventual “Alcotest 2” to make improvements on the existing API.

The full changelog is available here.


I’m only seeing 1.4 at opam - alcotest but I can see the package PR got merged here. [new release] alcotest, alcotest-async, alcotest-js, alcotest-mirage and alcotest-lwt (1.5.0) by CraigFe · Pull Request #19735 · ocaml/opam-repository · GitHub


The service serving the opam repository is down, works to bring it back to life and also to update it for good to something more stable are ongoing. The easiest workaround is to temporarily use git: Package index on opam.ocaml.org outdated? - #2 by rjbou