angular2-jsonapi icon indicating copy to clipboard operation
angular2-jsonapi copied to clipboard

Error during run test on Jest

Open przemyslawjanpietrzak opened this issue 6 years ago • 4 comments

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)

przemyslawjanpietrzak avatar Feb 08 '19 08:02 przemyslawjanpietrzak

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

WillGeller avatar Dec 12 '19 21:12 WillGeller

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

WillGeller avatar Dec 12 '19 21:12 WillGeller

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

userann avatar Dec 13 '19 08:12 userann

Running into this issue as well.

sean-clayton avatar Mar 04 '20 16:03 sean-clayton