moxios.requests.mostRecent() returns undefined
See original GitHub issueI use karma, jasmine and phantomJS with babel-polyfill. mostRecent always returns undefined even if I call axios in the test directly.
For example:
axios = require 'axios'
moxios = require 'moxios'
describe 'Test moxios', () ->
beforeEach () ->
moxios.install()
afterEach () ->
moxios.uninstall()
it 'mostRecent should return a request', () ->
axios('http://example.com').then (result) -> console.log result
moxios.wait () ->
console.log moxios.requests.mostRecent()
# undefined
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
moxios.requests.mostRecent() returns undefined
The problem is moxios.requests.mostRecent() in my test class always returns undefined . I went through https://github.com/axios/moxios/issues/ ...
Read more >moxios.requests.mostRecent() is returning undefined
I am using Webpack in React (16.12)and after running test getting below error. I am testing with Jest and enzyme.
Read more >moxios.requests.mostRecent(). always i am getting undefined
always i am getting undefined. “moxios.requests.mostRecent()” is published by Dileep Kumar.
Read more >Complete Intro to React
imdbID)(dispatchMock); moxios.wait(() => { const request = moxios.requests.mostRecent(); request .respondWith({ status: 200, response: oitnb }) .then(() ...
Read more >JavaScript moxios requests.mostRecent Examples
JavaScript requests.mostRecent - 21 examples found. These are the top rated real world JavaScript examples of moxios.requests.mostRecent extracted from open ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also I just realised this was mentioned in #1. So it works if i pass axios to 'moxios.install()`
Same issue