-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from austince/release/4.2.0
4.2.0
- Loading branch information
Showing
7 changed files
with
190 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Definitions by: Wim Looman <https://github.com/Nemo157> | ||
// Liam Jones <https://github.com/G1itcher> | ||
// Federico Caselli <https://github.com/CaselIT> | ||
// Bas Luksenburg <https://github.com/bas-l> | ||
// Austin Cawley-Edwards <https://github.com/austince> | ||
// TypeScript Version: 3.0 | ||
/// <reference types="chai" /> | ||
import * as request from 'superagent'; | ||
|
||
// Merge namespace with global chai | ||
declare global { | ||
namespace Chai { | ||
interface ChaiStatic { | ||
request: ChaiHttpRequest; | ||
} | ||
|
||
interface ChaiHttpRequest { | ||
(server: any): ChaiHttp.Agent; | ||
|
||
agent(server: any): ChaiHttp.Agent; | ||
|
||
addPromises(promiseConstructor: PromiseConstructorLike): void; | ||
} | ||
|
||
interface Assertion { | ||
redirectTo(location: string): Assertion; | ||
|
||
param(key: string, value?: string): Assertion; | ||
|
||
cookie(key: string, value?: string): Assertion; | ||
|
||
status(code: number): Assertion; | ||
|
||
statusCode(code: number): Assertion; | ||
|
||
header(key: string, value?: string | RegExp): Assertion; | ||
|
||
headers: Assertion; | ||
json: Assertion; | ||
text: Assertion; | ||
html: Assertion; | ||
redirect: Assertion; | ||
} | ||
|
||
interface TypeComparison { | ||
ip: Assertion; | ||
} | ||
} | ||
|
||
namespace ChaiHttp { | ||
interface Response extends request.Response {} | ||
interface Agent extends request.SuperAgentStatic { | ||
keepOpen(): Agent; | ||
close(callback?: (err: any) => void): Agent; | ||
} | ||
} | ||
} | ||
|
||
declare function chaiHttp(chai: any, utils: any): void; | ||
|
||
export = chaiHttp; |
Oops, something went wrong.