Socket
Socket
Sign inDemoInstall

nock

Package Overview
Dependencies
Maintainers
4
Versions
430
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nock - npm Package Compare versions

Comparing version 13.2.8 to 13.2.9

6

package.json

@@ -10,3 +10,3 @@ {

],
"version": "13.2.8",
"version": "13.2.9",
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",

@@ -49,7 +49,7 @@ "repository": {

"nyc": "^15.0.0",
"prettier": "2.6.2",
"prettier": "2.7.1",
"proxyquire": "^2.1.0",
"rimraf": "^3.0.0",
"semantic-release": "^19.0.2",
"sinon": "^13.0.1",
"sinon": "^14.0.0",
"sinon-chai": "^3.7.0",

@@ -56,0 +56,0 @@ "typescript": "^4.2.2"

@@ -849,2 +849,3 @@ # Nock

const scope = nock('http://api.myservice.com')
// Interceptors created after here will only match when the header `accept` equals `application/json`.
.matchHeader('accept', 'application/json')

@@ -855,2 +856,14 @@ .get('/')

})
.get('/')
// Only this interceptor will match the header value `x-my-action` with `MyFirstAction`
.matchHeader('x-my-action', 'MyFirstAction')
.reply(200, {
data: 'FirstActionResponse',
})
.get('/')
// Only this interceptor will match the header value `x-my-action` with `MySecondAction`
.matchHeader('x-my-action', 'MySecondAction')
.reply(200, {
data: 'SecondActionResponse',
})
```

@@ -857,0 +870,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc