diff --git a/types/nock/index.d.ts b/types/nock/index.d.ts index b82a0c44e0..b081072f08 100644 --- a/types/nock/index.d.ts +++ b/types/nock/index.d.ts @@ -23,6 +23,7 @@ declare namespace nock { function isActive(): boolean; function isDone(): boolean; function pendingMocks(): string[]; + function activeMocks(): string[]; function removeInterceptor(interceptor: Interceptor | RequestOptions): boolean; function disableNetConnect(): void; function enableNetConnect(matcher?: string | RegExp): void; @@ -81,6 +82,7 @@ declare namespace nock { isDone(): boolean; restore(): void; pendingMocks(): string[]; + activeMocks(): string[]; } interface Interceptor { @@ -113,6 +115,7 @@ declare namespace nock { reqheaders?: { [key: string]: string | RegExp | { (headerValue: string): boolean; }; }; badheaders?: string[]; filteringScope?: { (scope: string): boolean; }; + encodedQueryParams?: boolean; } interface RequestOptions { diff --git a/types/nock/nock-tests.ts b/types/nock/nock-tests.ts index ff8d73d9c0..c7f01cc6bf 100644 --- a/types/nock/nock-tests.ts +++ b/types/nock/nock-tests.ts @@ -604,6 +604,10 @@ if (!scope.isDone()) { } console.error('pending mocks: %j', nock.pendingMocks()); +/// .activeMocks() +nock.activeMocks(); // $ExpectType string[] +nock('http://example.com').activeMocks(); // $ExpectType string[] + // Logging google = nock('http://google.com').log(console.log);