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

isDone() working with mikeal/request? #94

Closed
mlchai opened this issue Feb 26, 2013 · 2 comments
Closed

isDone() working with mikeal/request? #94

mlchai opened this issue Feb 26, 2013 · 2 comments

Comments

@mlchai
Copy link

mlchai commented Feb 26, 2013

I'm using mikeal/request with nock, and running this sample code doesn't pass:

nock = require 'nock'
request = require 'request'
expect = require('chai').expect

describe 'hello', ->
it 'hello', (done) ->
n = nock('https://hello.dev')
.post('/world')
.reply(200, 'hello world')
m = request.post {url: 'https://hello.dev/world'}, (err, res, body) ->
console.log body
done()
expect(n.isDone()).to.equal(true)

However, when I use https or http, it passes. Can anyone else reproduce this, or is this just an issue on my end?

Also want to add that if I change the expect to equal false, it does pass and "hello world" is indeed printed so nock does seem to catch the request, but it's still flagged as not done.

EDIT: It seems that the isDone() is running before it finishes maybe, which is weird since http works so I'll have to look into this a little more.

@mlchai mlchai closed this as completed Feb 26, 2013
@arnaugm
Copy link

arnaugm commented Nov 6, 2014

I'm having the same problem, did you find a solution?

@lock
Copy link

lock bot commented Sep 14, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Sep 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants