diff --git a/package.json b/package.json index 8e65cde..49650a9 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/nock-graphql.ts b/src/nock-graphql.ts index 6e08945..c7344d1 100644 --- a/src/nock-graphql.ts +++ b/src/nock-graphql.ts @@ -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. */