I use https://github.com/github/fetch in my application that works fine, but I would like to test my code with Mocha and babel ever since I write ES2016.
This does not work. I get:
1) testApi.js Test api error handling:
ReferenceError: fetch is not defined
at callApi (callApi.js:10:10)
at Context.<anonymous> (testApi.js:8:40)
Because well, the sample is not defined. When I create a selection for the browser, webpack is exposed.
I tried using https://github.com/bitinn/node-fetch , but the api is slightly different and requires, for example, a full URL instead of relative paths.
Is there a solution to this problem?
Tieme source
share