mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add a missing call and missing options to nock index.d.ts (#35166)
* Bumped ver to 10.0.1 nock.activeMocks() is missing => added function activeMocks(): string[]; to the nock namespace. nock( 'https://api.github.com' , {"encodedQueryParams":true}) => added encodedQueryParams: boolean to the Options interface. * Updated per previous comments However, I don't know what this error is that is causing Travis CI to fail??? ``` Error: ../node/v7/index.d.ts: Definitions must use global references to other packages, not parent ("../xxx") references.(Based on reference 'base.d.ts') ``` * Update tests for activeNocks * Dedent/remove 'function' from activeMocks in Scope interface * linter changes
This commit is contained in:
committed by
Jesse Trinity
parent
900439b8b7
commit
cb425140db
3
types/nock/index.d.ts
vendored
3
types/nock/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user