You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is an issue with my implementation or a problem with the "default as" export syntax not being supported by Jest.
Error message:
● Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers.
Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
Error location
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export {default as create} from "./create.js";
^^^^^^
SyntaxError: Unexpected token 'export'
1 | import React, { useMemo, useRef } from 'react';
> 2 | import Tree, { CustomNodeElementProps, RawNodeDatum } from 'react-d3-tree';
Thoughts on how this can be resolved?
The text was updated successfully, but these errors were encountered:
This allows the tests to run, but I'm not sure how much overhead this adds to tests that are already quite slow. Attempting to mock the react-d3-tree components/interfaces entirely hadn't gotten me anywhere yet.
Not sure if this is an issue with my implementation or a problem with the "default as" export syntax not being supported by Jest.
Error message:
Error location
Thoughts on how this can be resolved?
The text was updated successfully, but these errors were encountered: