Jul 20, 2017 · 1 min read
Mine (using version 4.0) needs to initialize ResponseOptions, like this:
new Response(new ResponseOptions({
body: JSON.stringify(mockData)
}))If I follow your code, the response.body will be ReadableStream , causing json parsing fail. Further issue could be found here: https://stackoverflow.com/questions/43612837/error-when-unit-testing-uncaught-in-promise-syntaxerror-unexpected-token-o
