Reputation: 529
I've recreated the issue in this repo:
https://github.com/umarmw/lopital-sdk
whereby when executing lerna run test
, it throws this error:
FAIL __tests__/doctor.test.js
● Test suite failed to run
SyntaxError: /codebox/lopital-sdk/packages/doctor/__tests__/doctor.test.js: Support for the experimental syntax 'jsx' isn't currently enabled (9:24):
7 | describe('doctor', () => {
8 | it('should be selectable by class "foo"', function() {
> 9 | expect(shallow(<Doctor title="MO" />).is('.btn-doctor')).toBe(true);
| ^
10 | });
11 |
12 | it('should mount in a full DOM', function() {
Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.
I've added this @babel/preset-react
in the babel preset, but it's not solving the issue.
Any idea?
Upvotes: 1
Views: 587
Reputation: 529
I've fixed the above issue by adding babel.config.json
inside each package folder as lerna
will try to execute the code relative to each package.
Upvotes: 1