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

request.reject undefined (using typescript) #68

Closed
dbeff opened this issue Oct 10, 2019 · 2 comments
Closed

request.reject undefined (using typescript) #68

dbeff opened this issue Oct 10, 2019 · 2 comments

Comments

@dbeff
Copy link

dbeff commented Oct 10, 2019

Following the example below from the README.de file, I'm getting request.reject equal to undefined. The only way that I was able to mock an error on the request was by using respondWith passing status 4xx. Am I doing something wrong?

moxios.wait(function () {
  let request = moxios.requests.mostRecent()
  request.reject(errorResp)
  }).catch(function (err) {
    equal(err.status, errorResp.status)
    equal(err.response.message, errorResp.response.message)
    done()
  })
})
@seemX17
Copy link

seemX17 commented Dec 10, 2019

I'm facing the same issue, did you manage to figure what was going wrong ?

@yuri-gagarin
Copy link

seems like no type definition for moxios.reject()

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

4 participants