bloodyowl / rescript-test

A lightweight test framework for ReScript
https://bloodyowl.github.io/rescript-test/
MIT License
78 stars 9 forks source link

Wildcard test does not work (on Windows?) #6

Closed huntwj closed 2 years ago

huntwj commented 2 years ago

On Windows, and my intuition says that's relevant.

In any case, using the wildcard syntax from your installation demo does not work, but specifying individual files works fine.

PS C:\blah\web> yarn test
yarn run v1.22.17
$ retest tests/*.mjs
internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\blah\web\tests\*.mjs' imported from C:\blah\web\node_modules\rescript-test\bin\retest.mjs
    at finalizeResolution (internal/modules/esm/resolve.js:285:11)
    at moduleResolve (internal/modules/esm/resolve.js:708:10)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:819:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at Loader.import (internal/modules/esm/loader.js:177:28)
    at importModuleDynamically (internal/modules/esm/translators.js:114:35)
    at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
    at file:///C:/Users/huntw/dev/swtor-companion/web/node_modules/rescript-test/bin/retest.mjs:67:41
    at Array.map (<anonymous>) {
  code: 'ERR_MODULE_NOT_FOUND'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS C:\blah\web> yarn retest tests/MyTest.mjs
yarn run v1.22.17
$ C:\blah\web\node_modules\.bin\retest tests/MyTest.mjs
1/1: test test
  PASS - 1 should equal 1

# Ran 1 tests (1 assertions)
# 1 passed
# 0 failed
Done in 0.57s.
PS C:\blah\web> 
ChrisTritton commented 2 years ago

Yes, same problem but on Linux, do you know how to fix it? Keen on this lightweight framework

rescript-test

bloodyowl commented 2 years ago

Can you try with v3.2.0 and wrapping the glob in quotes?

$ retest 'tests/*.mjs'
ChrisTritton commented 2 years ago

Success!! Thank you!