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

chore(#2185): add test to ensure recorder works when response stream not put in flowing mode #2257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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