Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

declarative-nock

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

declarative-nock - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

3

lib/declarative-nock.d.ts

@@ -48,2 +48,5 @@ /*

}): void;
addJestHooks({ disableNetConnect, }?: {
disableNetConnect?: boolean;
}): void;
}

@@ -95,3 +95,20 @@ /*

}
addJestHooks({ disableNetConnect = true, } = {}) {
beforeAll(() => {
this.installMocks();
if (disableNetConnect) {
debug('disableNetConnect');
this.nock.disableNetConnect();
}
});
afterAll(() => {
this.removeMocks();
if (disableNetConnect) {
debug('enableNetConnect');
this.nock.enableNetConnect();
}
});
afterEach(() => this.resetAll());
}
}
exports.DeclarativeNock = DeclarativeNock;

3

package.json
{
"name": "declarative-nock",
"version": "1.0.1",
"version": "1.1.0",
"description": "Declarative Nock",

@@ -68,2 +68,3 @@ "license": "BSD-3-Clause",

"@types/debug": "^4.1.7",
"@types/jest": "^29.2.0",
"@types/mocha": "^9.0.1",

@@ -70,0 +71,0 @@ "@types/node": "^15.12.4",

[![nlm-github](https://img.shields.io/badge/github-groupon%2Fdeclarative--nock%2Fissues-F4D03F?logo=github&logoColor=white)](https://github.com/groupon/declarative-nock/issues)
![nlm-node](https://img.shields.io/badge/node-%3E%3D12-blue?logo=node.js&logoColor=white)
![nlm-version](https://img.shields.io/badge/version-1.0.1-blue?logo=version&logoColor=white)
![nlm-version](https://img.shields.io/badge/version-1.1.0-blue?logo=version&logoColor=white)
# `declarative-nock`

@@ -95,2 +95,3 @@

addMochaHooks(opts?: { disableNetConnect: boolean = true }): void;
addJestHooks(opts?: { disableNetConnect: boolean = true }): void;
}

@@ -144,2 +145,7 @@ ```

#### `addJestHooks({ disableNetConnect = true })`
Exactly like `addMochaHooks()` except calls `beforeAll()` and `afterAll()`
instead of `before()` and `after()` to work with Jest.
#### `nock`

@@ -146,0 +152,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