Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
after(() => {
shimmer.unwrap(Service.prototype, 'getProjectId');
oauth2Scope.done(); // It will likely be called at least once
nock.enableNetConnect();
});
before(() => {
nock.disableNetConnect();
oauth2Scope = oauth2().persist();
shimmer.wrap(
Service.prototype,
'getProjectId',
() =>
function(this: Service) {
return getProjectIdOverride().then(projectId => {
this.projectId = projectId;
return projectId;
});
}
);
});