本文整理汇总了TypeScript中nock.removeInterceptor函数的典型用法代码示例。如果您正苦于以下问题:TypeScript removeInterceptor函数的具体用法?TypeScript removeInterceptor怎么用?TypeScript removeInterceptor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了removeInterceptor函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should not download the artifact if it already exists', async () => {
const artifactRequestInterceptor = nock(BASE_URL).get(ARTIFACT_PATH);
const artifactRequest = artifactRequestInterceptor.reply(200, ARTIFACT_CONTENTS);
EXISTS_RESULT = true;
await retriever.downloadBuildArtifact(12345, 777, 'COMMIT', ARTIFACT_PATH);
expect(existsSpy).toHaveBeenCalled();
expect(getBuildArtifactUrlSpy).not.toHaveBeenCalled();
expect(artifactRequest.isDone()).toEqual(false);
nock.removeInterceptor(artifactRequestInterceptor);
});
示例2: nock
/// logging option
var nullAppender = (content: string) => { };
nock.recorder.rec({
logging: nullAppender
});
/// use_separator option
nock.recorder.rec({
use_separator: false
});
// .removeInterceptor()
nock.removeInterceptor({
hostname : 'localhost',
path : '/mockedResource'
});
nock.removeInterceptor({
hostname : 'localhost',
path : '/login',
method: 'POST',
proto : 'https'
});
var interceptor = nock('http://example.org')
.get('somePath');
nock.removeInterceptor(interceptor);
// Events
/// Global no match event