Skip to content

Commit

Permalink
nock#1836 fixes expected Node behaviour for http.get
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethaasan committed Jan 10, 2020
1 parent 94eba86 commit 7cfbb19
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_common.js
Expand Up @@ -516,13 +516,13 @@ test('testing timers are deleted correctly', t => {

test('correct node behavior', t => {
const scope = nock('http://example.test')
.get('/')
.reply()
.get('/')
.reply()

const req = sinon.spy()
const origHttpReq = http.request;
const origHttpReq = http.request

http.request = req;
http.request = req

http.get('http://example.test', res => {
t.equal(res.statusCode, 200)
Expand All @@ -532,7 +532,7 @@ test('correct node behavior', t => {
res.on('end', () => {
expect(req).to.have.been.notCalled()
scope.done()
http.request = origHttpReq;
http.request = origHttpReq
t.end()
})
})
Expand Down

0 comments on commit 7cfbb19

Please sign in to comment.