viclafouch / mui-color-input

📌 A color input designed for MUI (Material ui) V6 built with TinyColor
https://viclafouch.github.io/mui-color-input/
60 stars 20 forks source link

JEST - SyntaxError: Cannot use import statement outside a module #22

Closed radelcom closed 11 months ago

radelcom commented 11 months ago

Describe the bug Struggling to get correct transformation of ES to work on unit testings. Tried adding babel to deal with transformation but still not able to get it right for some reason.

({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { jsx as c, jsxs as lt, Fragment as Mt } from "react/jsx-runtime";

    SyntaxError: Cannot use import statement outside a module

Tried:

Any help would be greatly appreciated!

viclafouch commented 11 months ago

Hello !

Maybe check this : https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/

Hope it will help !

Matt-Butler commented 2 months ago

Just curious, has anyone has gotten this to work?