Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

axios doesn’t work with fakeweb #27

Open
macabeus opened this issue Jul 24, 2018 · 0 comments
Open

axios doesn’t work with fakeweb #27

macabeus opened this issue Jul 24, 2018 · 0 comments

Comments

@macabeus
Copy link

macabeus commented Jul 24, 2018

Using axios version 0.16.0 and fakeweb version 1.1.0, fakeweb made axios raises an exception when access the URL, but the same URL works when using another lib, like prequest.

googleSpy = fakeweb.registerUri({uri: 'http://www.google.com/', body: 'Hello' })
// returns: { used: false, useCount: 0 }

prequest({url: 'http://www.google.com/' }).then(console.log)
// returns: Hello

axios.post('http://www.google.com/').catch(err => console.log(err))
/* returns:
TypeError [ERR_INVALID_ARG_TYPE]: The "list" argument must be one of type Array, Buffer, or Uint8Array
    at Function.concat (buffer.js:465:13)
    at EventEmitter.handleStreamEnd (/Users/macabeus/Desktop/pagarme-core/gateway/node_modules/axios/lib/adapters/http.js:180:37)
    at EventEmitter.emit (events.js:180:13)
    at EventEmitter.emit (domain.js:440:23)
    at EventEmitter.thisRequest.end (node_modules/node-fakeweb/src/lib/overrides.js:67:18)
    at RedirectableRequest.end (node_modules/follow-redirects/index.js:128:23)
    at dispatchHttpRequest (node_modules/axios/lib/adapters/http.js:223:11)
    at new Promise (<anonymous>)
    at httpAdapter (node_modules/axios/lib/adapters/http.js:19:10)
    at dispatchRequest (node_modules/axios/lib/core/dispatchRequest.js:52:10)
*/
@macabeus macabeus changed the title axios can't works with fakeweb axios doesn’t work with fakeweb Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant