What is the expected behavior?
When allowUnmocked is set to true there should be no change in how nock matches requests.
What is the actual behavior?
When allowUnmocked is set to true, query strings must be specified using the .query function, not in the path string.
Possible solution
This is sort of the opposite problem as #490, which was fixed in #955. That fix may have introduced this problem.
How to reproduce the issue
'use strict'
const nock = require('nock')
const http = require('http')
nock('http://localhost', {allowUnmocked: true})
.get('/foo?bar=baz')
.reply(418, 'Teapots')
const req = http.get('/foo?bar=baz', (res) => {
console.log(res.statusCode)
})
req.on('error', console.error)
Does the bug have a test case?
Versions
| Software |
Version(s) |
| Nock |
9.1.9, 10.0.6 |
| Node |
8.12.0, 10.15.1 |
What is the expected behavior?
When
allowUnmockedis set totruethere should be no change in how nock matches requests.What is the actual behavior?
When
allowUnmockedis set totrue, query strings must be specified using the.queryfunction, not in the path string.Possible solution
This is sort of the opposite problem as #490, which was fixed in #955. That fix may have introduced this problem.
How to reproduce the issue
Does the bug have a test case?
Versions