Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 540ba73

Browse files
committed
feat: add activate method
1 parent 92ab6b2 commit 540ba73

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"test:coverage": "npm run test --coverage --colors",
3232
"prepare": "husky install",
3333
"tsc:check": "tsc --noEmit",
34-
"prepublish": "npm run build",
3534
"release": "semantic-release"
3635
},
3736
"peerDependencies": {

src/nock-graphql.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ export default class NockGraphQL {
4747
return scope;
4848
}
4949

50+
/**
51+
* Activate method. Preferable to call it beforeEach or beforeAll.
52+
*/
53+
activate(): void {
54+
if (!nock.isActive()) {
55+
nock.activate();
56+
}
57+
}
58+
5059
/**
5160
* Cleanup method. Preferable to call it afterEach or afterAll.
5261
*/

0 commit comments

Comments
 (0)