luisanton-io / recoil-nexus

MIT License
163 stars 13 forks source link

jest fails with SyntaxError: Cannot use import statement outside a module #12

Closed francois-pasquier closed 2 years ago

francois-pasquier commented 2 years ago

The library works fine but it's broken when testing files using it.

    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { useRecoilCallback } from 'recoil';
                                                                                             ^^^^^^

    SyntaxError: Cannot use import statement outside a module

EDIT: I fixed this by using transformIgnorePatterns': [] in my jest.config.js