I created a new project using reason-scripts. When I run yarn test
, I get this error:
FAIL src/App_test.re
● Test suite failed to run
/Users/fhsu/reference/hello/node_modules/@glennsl/bs-jest/src/jest.js:3
import * as List from "bs-platform/lib/es6/list.js";
^
SyntaxError: Unexpected token *
at new Script (vm.js:74:7)
at Object.<anonymous> (src/App_test.re:3:36)
In my bsconfig.json, if I change package-specs from es6 to commonjs, the tests pass. However, I generally want to compile as es6 so that I get dead code elimination. What’s the workaround for this? Write a script that automatically changes package-specs to commonjs whenever I want to run my tests?