migration_guides/migrating_to_12.md
Support for Node < 10 was dropped.
To upgrade Nock, ensure your version of Node is also updated.
At the time of release, Node 10.x, 12.x, and 13.x were supported.
cleanAll() no longer returns the global nock instance (#1872).
// before
nock.cleanAll().restore() // Uncaught TypeError: Cannot read property 'restore' of undefined
// upgraded
nock.cleanAll()
nock.restore()
Support was dropped for the String constructor (#1873).
Only string primitive are supported. All strings passed to Nock for options should not use new String syntax.
MDN web docs.
enableNetConnect() now accepts a function.
nock.enableNetConnect(
host => host.includes('amazon.com') || host.includes('github.com'),
)