cometkim / rescript-vitest

ReScript bindings to Vitest
MIT License
42 stars 9 forks source link

Compiles with ReScript v11 #18

Closed illusionalsagacity closed 2 months ago

illusionalsagacity commented 2 months ago

This resolves #14 -- consumers can use ReScript v11 with or without uncurried mode.

The main change to get this working is to be more explicit with these curried external functions:

-      . ~name: string,
-      ~f: @uncurry 'a => unit,
-      ~timeout: Js.undefined<int>,
-    ) => unit = "each"
+    ) => (. ~name: string, ~f: @uncurry 'a => unit, ~timeout: Js.undefined<int>) => unit = "each"

This lets rescript-vitest compile on 10.1 and 11 regardless of uncurried mode.

The manual calls of instead of piping only_describe->describe for currying into the functors are for the ease of conversion to describe(only_describe, ...) which I have a different branch for. However I don't think you necessarily need to switch to uncurried for this right away, library consumers will just be prompted to use whatever function syntax their compiler settings are for.

cometkim commented 2 months ago

Thanks @illusionalsagacity ! Will release new version soon