Closed ghost closed 5 years ago
This is a known issue. Tests are currently broken on the latest version.
I tried updating bs-jest to use the latest version inside reason-scripts, and now I'm getting:
/node_modules/@glennsl/bs-jest/src/jest.js:3
import * as List from "bs-platform/lib/es6/list.js";
^^^^^^
SyntaxError: Unexpected token import
It's because of the ES modules flag being enabled, and Jest not being able to process it. Working on the fix ATM
I fixed the original issue in bs-loader
. Relevant commit: https://github.com/reasonml-community/bs-loader/commit/7b5b1a8441a8f289454c51c045aaf59b850a49c0
Not sure if this still needs to remain open because of the ES6 import
error?
Would be nice if another issue was opened about ES modules import bug, just trying Reason first time today and stumbled directly into it when trying 'yarn test'.
Just a follow up on this...
I'm wondering why this commit doesn't seem to be part of the beta4 release. https://github.com/reasonml-community/reason-scripts/commit/71ecde5c4326fd6298170d1bedf5d8379ef133f7
I created a new project using beta4 and it doesn't match App_test.re. But referring master directly from github in package.json does the trick. However, I get a "Test suite failed to run" message with any apparent error for the standard "addition" sample test.
@matdurand that's... weird. I'll double check tomorrow, and will cut a new release if I see the same.
Hi everyone! I just ran into this issue @matdurand mentioned. Does anyone know if there's a fix or a workaround for it yet?
As stated here there will be a new release with a fix for this. Altho I wasn't able to test it yet.
For now you could replace in your bsconfig.json
es6
with commonjs
"package-specs": {
"module": "commonjs",
"in-source": true
},
Tests are pretty broke in reason-scripts, and there's no expected fix.
Hi guys,
I'm trying to run the tests but got "TypeError: Path must be a string.". I tried to install a new version of jest but it's not working as well.