stellar / js-xdr

Read/write XDR encoded data structures (RFC 4506)
Apache License 2.0
25 stars 31 forks source link

Unexpected Identifier with jest #28

Closed imerkle closed 5 years ago

imerkle commented 5 years ago

When using stellar base library jest shows an error

node_modules/js-xdr/src/cursor.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import BaseCursor from 'cursor';
                                                                                                    ^^^^^^^^^^

    SyntaxError: Unexpected identifier

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:440:17)
      at Object.<anonymous> (node_modules/js-xdr/lib/cursor.js:10:15)
imerkle commented 5 years ago

Removing ./src/ from build output solves it

rloukil commented 4 years ago

can you please tell me how you did it?