ghidoz / angular2-jsonapi

A lightweight Angular 2 adapter for JSON API
199 stars 122 forks source link

Error during run test on Jest #209

Open przemyslawjanpietrzak opened 5 years ago

przemyslawjanpietrzak commented 5 years ago

After migrate from karma to jest i get error:

Test suite failed to run

    /Users/przemyslawpietrzakfrontend/node_modules/lodash-es/find.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import createFind from './_createFind.js';

    SyntaxError: Unexpected identifier

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:440:17)
      at Object.<anonymous> (node_modules/angular2-jsonapi/src/models/json-api.model.ts:1:1)
WillGeller commented 4 years ago

@ghidoz I am running into the same issue, any thoughts on solution?

WillGeller commented 4 years ago

I found this S.O. thread but it is inconclusive https://stackoverflow.com/questions/57222538/test-suite-failed-to-run-syntax-error-unexpected-identifier

userann commented 4 years ago

if I remember right....to work along with json api, I created that mocks folder, created angular2-jsonapi.ts file and mocked JsonApiModel...like this(i think, not sure but you can try):

image

sean-clayton commented 4 years ago

Running into this issue as well.