Thinh Bui
Thinh Bui
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

)

    Thinh Bui

    Thinh Bui

    Web Developer at MaurisVN

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade