Closed mellson closed 2 years ago
Is it correct that if I run pta with --module-loader es, it should treat the test files as es modules no matter the file name?
Not really, it just tells pta
which zora singleton it should use (cjs, esm). Your package.json should still reflect the repository set up. If your files are effectively written in ESM, you'll have then to add type=module
in your package.json.
You can refer to the test/samples for more details.
Thanks for the info. My problem is that I'm using some dependencies which does not play nice with .mjs
or type=module
. So I "only" need a way to force the test runner to accept that my files are indeed es modules. Currently I got it working by using onchange
to rename the files from .bs.js
to .mjs
but it feels a bit hacky.
in favor of https://github.com/lorenzofox3/zora/issues/155
Is it correct that if I run pta with
--module-loader es
, it should treat the test files as es modules no matter the file name? My files have the.bs.js
suffix because I need compatibility with other dependencies that only work with that suffix. If I manually rename the files to.mjs
, it works. But it would be great if I could force pta to treat my files as es modules.