Merge pull request #24087 from cwoodland/master

Frisby JS 2.0 Modify FrisbySpec definition to make params optional
This commit is contained in:
Armando Aguirre
2018-03-06 12:31:31 -08:00
committed by GitHub
+18 -7
View File
@@ -18,16 +18,27 @@ export import Joi = require("joi");
// #region Frisby FrisbySpec Methods
// Reference file: https://github.com/vlucas/frisby/blob/master/src/frisby/spec.js
// **************************************CHANGE LOG**************************************
// C.E.W. This is an attempt to create some sort of changelog for these types.
// If you make any changes, please try and note those changes in this section.
// If this section gets too long we can always trim it.
// ## 2018-03-05
// ### Changed
// - Update _Frisbyspec.get_, _Frisbyspec.post_, _Frisbyspec.put_, _Frisbyspec.del_, _Frisbyspec.patch_, _Frisbyspec.fetch_ to allow _params_ to be optional.
// - Update _FrisbySpec.then_ to allow _onRejected_ to be optional.
// **************************************CHANGE LOG**************************************
export class FrisbySpec {
constructor(...args: any[]);
catch(onRejected?: (error: Error) => void): FrisbySpec;
del(url: string, params: {}): FrisbySpec;
del(url: string, params?: {}): FrisbySpec;
done(doneFn: (...args: any[]) => void): FrisbySpec;
expect(expectName: string, ...args: any[]): FrisbySpec;
expectNot(expectName: string): FrisbySpec;
fetch(url: string, params: {}, options?: {}): FrisbySpec;
fetch(url: string, params?: {}, options?: {}): FrisbySpec;
fromJSON(json: {}): FrisbySpec;
get(url: string, params: {}): FrisbySpec;
get(url: string, params?: {}): FrisbySpec;
getBaseUrl(): string | boolean;
inspectBody(): FrisbySpec;
inspectHeaders(): FrisbySpec;
@@ -37,12 +48,12 @@ export class FrisbySpec {
inspectRequestHeaders(): FrisbySpec;
inspectResponse(): FrisbySpec;
inspectStatus(): FrisbySpec;
patch(url: string, params: {}): FrisbySpec;
post(url: string, params: {}): FrisbySpec;
patch(url: string, params?: {}): FrisbySpec;
post(url: string, params?: {}): FrisbySpec;
promise(): Promise<nodeFetch.Response>;
put(url: string, params: {}): FrisbySpec;
put(url: string, params?: {}): FrisbySpec;
setup(opts: {}, replace: boolean): FrisbySpec;
then(onFulfilled: {} | ((...args: any[]) => void), onRejected: (...args: any[]) => void): FrisbySpec;
then(onFulfilled: {} | ((...args: any[]) => void), onRejected?: (...args: any[]) => void): FrisbySpec;
timeout(timeout: number): number;
use(fn: (...args: any[]) => void): FrisbySpec;
static addExpectHandler(expectName: string, expectFn: (...args: any[]) => any): void;