cometkim / rescript-vitest

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

TypeError: Cannot read properties of undefined (reading 'only') #13

Closed mvaled closed 11 months ago

mvaled commented 1 year ago

I'm migrating the tests we have in one our libraries to vitest using rescript-vitest.

However, the require fails with:

 FAIL  lib/js/tests/basic.test.js [ lib/js/tests/basic.test.js ]
TypeError: Cannot read properties of undefined (reading 'only')
 ❯ Object.<anonymous> node_modules/rescript-vitest/lib/js/src/Vitest.js:327:38
 ❯ lib/js/tests/basic.test.js:6:14
      4| var Curry = require("rescript/lib/js/curry.js");
      5| var Deser = require("../src/Deser.js");
      6| var Vitest = require("rescript-vitest/lib/js/src/Vitest.js");
       |              ^
      7| var Vitest$1 = require("vitest");
      8| var Prelude = require("@kaiko.io/rescript-prelude/lib/js/src/Prelude.js");
mvaled commented 11 months ago

Hi @cometkim,

Could you please take a look at this issue?

mvaled commented 11 months ago

I notice this only happens because rescript-vitest only generates 'mjs'; so I can fix this on my side.