You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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!
lockbot
locked as resolved and limited conversation to collaborators
Sep 14, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: