Skip to content

Commit

Permalink
chore(#2185): add test to ensure recorder works when response stream …
Browse files Browse the repository at this point in the history
…not put in flowing mode
  • Loading branch information
att14 committed Nov 30, 2021
1 parent 42ef991 commit 77cac14
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_recorder.js
Expand Up @@ -53,6 +53,20 @@ describe('Recorder', () => {
expect(outputs[0]).to.match(/\.post\('\/bar'\)/)
})

it('records requests where response stream is not put into flowing mode', async () => {
const { origin } = await servers.startHttpServer()

nock.restore()
nock.recorder.clear()
nock.recorder.rec(true)

await http.get(`${origin}/foo`)

const outputs = nock.recorder.play()
expect(outputs).to.have.lengthOf(1)
expect(outputs[0]).to.match(/\.get\('\/foo'\)/)
})

it('when request port is different, use the alternate port', async () => {
nock.restore()
nock.recorder.clear()
Expand Down

0 comments on commit 77cac14

Please sign in to comment.