Skip to content

Commit

Permalink
feat: add activate method
Browse files Browse the repository at this point in the history
  • Loading branch information
batrdn committed Mar 3, 2024
1 parent 92ab6b2 commit 540ba73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"test:coverage": "npm run test --coverage --colors",
"prepare": "husky install",
"tsc:check": "tsc --noEmit",
"prepublish": "npm run build",
"release": "semantic-release"
},
"peerDependencies": {
Expand Down
9 changes: 9 additions & 0 deletions src/nock-graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ export default class NockGraphQL {
return scope;
}

/**
* Activate method. Preferable to call it beforeEach or beforeAll.
*/
activate(): void {
if (!nock.isActive()) {
nock.activate();
}
}

/**
* Cleanup method. Preferable to call it afterEach or afterAll.
*/
Expand Down

0 comments on commit 540ba73

Please sign in to comment.