123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- declare function expect(target?: any): Expect.Root;
- declare module Expect {
- interface Assertion {
-
- ok(): void;
-
- throwError(fn?: (exception: any) => void): void;
-
- throwException(fn?: (exception: any) => void): void;
-
- throwError(regexp: RegExp): void;
-
- throwException(regexp: RegExp): void;
-
- empty(): Assertion;
-
- equal(obj: any): Assertion;
-
- eql(obj: any): Assertion;
-
- within(start: number, finish: number): Assertion;
-
- a(type: string): Assertion;
-
- a(type: Function): Assertion;
-
- an: An;
-
- greaterThan(n: number): Assertion;
-
- above(n: number): Assertion;
-
- lessThan(n: number): Assertion;
-
- below(n: number): Assertion;
-
- match(regexp: RegExp): Assertion;
-
- length(n: number): Assertion;
-
- property(name: string, val?: any): Assertion;
-
- contain(str: string): Assertion;
- string(str: string): Assertion;
-
- contain(obj: any): Assertion;
- string(obj: any): Assertion;
-
- key(keys: string[]): Assertion;
-
- key(...keys: string[]): Assertion;
-
- keys(keys: string[]): Assertion;
-
- keys(...keys: string[]): Assertion;
-
- fail(message?: string): Assertion;
- }
- interface Root extends Assertion {
- not: Not;
- to: To;
- only: Only;
- have: Have;
- be: Be;
- }
- interface Be extends Assertion {
-
- (obj: any): Assertion;
- an: An;
- }
- interface An extends Assertion {
-
- (type: string): Assertion;
-
- (type: Function): Assertion;
- }
- interface Not extends Expect.NotBase {
- to: Expect.ToBase;
- }
- interface NotBase extends Assertion {
- be: Be;
- have: Have;
- include: Assertion;
- only: Only;
- }
- interface To extends Expect.ToBase {
- not: Expect.NotBase;
- }
- interface ToBase extends Assertion {
- be: Be;
- have: Have;
- include: Assertion;
- only: Only;
- }
- interface Only extends Assertion {
- have: Have;
- }
- interface Have extends Assertion {
- own: Assertion;
- }
- }
- declare module "expect.js" {
- export = expect;
- }
|