Skip to content

Commit

Permalink
feat(core): add typescript declarations for typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Broad authored and JamieMason committed Oct 30, 2017
1 parent 9edccf4 commit 105bcc3
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
83 changes: 83 additions & 0 deletions jasmine-matchers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
declare namespace jasmine {
interface Matchers {
toBeAfter(otherDate: Date, expectationFailOutput?: any): boolean;
toBeArray(expectationFailOutput?: any): boolean;
toBeArrayOfBooleans(expectationFailOutput?: any): boolean;
toBeArrayOfNumbers(expectationFailOutput?: any): boolean;
toBeArrayOfObjects(expectationFailOutput?: any): boolean;
toBeArrayOfSize(size: number, expectationFailOutput?: any): boolean;
toBeArrayOfStrings(expectationFailOutput?: any): boolean;
toBeBefore(otherDate: Date, expectationFailOutput?: any): boolean;
toBeBoolean(expectationFailOutput?: any): boolean;
toBeCalculable(expectationFailOutput?: any): boolean;
toBeDate(expectationFailOutput?: any): boolean;
toBeEmptyArray(expectationFailOutput?: any): boolean;
toBeEmptyObject(expectationFailOutput?: any): boolean;
toBeEmptyString(expectationFailOutput?: any): boolean;
toBeEvenNumber(expectationFailOutput?: any): boolean;
toBeFalse(expectationFailOutput?: any): boolean;
toBeFunction(expectationFailOutput?: any): boolean;
toBeHtmlString(expectationFailOutput?: any): boolean;
toBeIso8601(expectationFailOutput?: any): boolean;
toBeJsonString(expectationFailOutput?: any): boolean;
toBeLongerThan(other: string, expectationFailOutput?: any): boolean;
toBeNonEmptyArray(expectationFailOutput?: any): boolean;
toBeNonEmptyObject(expectationFailOutput?: any): boolean;
toBeNonEmptyString(expectationFailOutput?: any): boolean;
toBeNumber(expectationFailOutput?: any): boolean;
toBeObject(expectationFailOutput?: any): boolean;
toBeOddNumber(expectationFailOutput?: any): boolean;
toBeSameLengthAs(other: string, expectationFailOutput?: any): boolean;
toBeShorterThan(other: string, expectationFailOutput?: any): boolean;
toBeString(expectationFailOutput?: any): boolean;
toBeTrue(expectationFailOutput?: any): boolean;
toBeWhitespace(expectationFailOutput?: any): boolean;
toBeWholeNumber(expectationFailOutput?: any): boolean;
toBeWithinRange(floor: number, ceiling: number, expectationFailOutput?: any): boolean;

toEndWith(subString: string, expectationFailOutput?: any): boolean;

toHaveArray(key: string, expectationFailOutput?: any): boolean;
toHaveArrayOfBooleans(key: string, expectationFailOutput?: any): boolean;
toHaveArrayOfNumbers(key: string, expectationFailOutput?: any): boolean;
toHaveArrayOfObjects(key: string, expectationFailOutput?: any): boolean;
toHaveArrayOfSize(key: string, size?: number, expectationFailOutput?: any): boolean;
toHaveArrayOfStrings(key: string, expectationFailOutput?: any): boolean;
toHaveBoolean(key: string, expectationFailOutput?: any): boolean;
toHaveCalculable(key: string, expectationFailOutput?: any): boolean;
toHaveDate(key: string, expectationFailOutput?: any): boolean;
toHaveDateAfter(key: string, otherDate: Date, expectationFailOutput?: any): boolean;
toHaveDateBefore(key: string, otherDate: Date, expectationFailOutput?: any): boolean;
toHaveEmptyArray(key: string, expectationFailOutput?: any): boolean;
toHaveEmptyObject(key: string, expectationFailOutput?: any): boolean;
toHaveEmptyString(key: string, expectationFailOutput?: any): boolean;
toHaveEvenNumber(key: string, expectationFailOutput?: any): boolean;
toHaveFalse(key: string, expectationFailOutput?: any): boolean;
toHaveHtmlString(key: string, expectationFailOutput?: any): boolean;
toHaveIso8601(key: string, expectationFailOutput?: any): boolean;
toHaveJsonString(key: string, expectationFailOutput?: any): boolean;
toHaveMember(key: string, expectationFailOutput?: any): boolean;
toHaveMethod(key: string, expectationFailOutput?: any): boolean;
toHaveNonEmptyArray(key: string, expectationFailOutput?: any): boolean;
toHaveNonEmptyObject(key: string, expectationFailOutput?: any): boolean;
toHaveNonEmptyString(key: string, expectationFailOutput?: any): boolean;
toHaveNumber(key: string, expectationFailOutput?: any): boolean;
toHaveNumberWithinRange(key: string, floor: number, ceiling: number, expectationFailOutput?: any): boolean;
toHaveObject(key: string, expectationFailOutput?: any): boolean;
toHaveOddNumber(key: string, expectationFailOutput?: any): boolean;
toHaveString(key: string, expectationFailOutput?: any): boolean;
toHaveStringLongerThan(key: string, other: string, expectationFailOutput?: any): boolean;
toHaveStringSameLengthAs(key: string, other: string, expectationFailOutput?: any): boolean;
toHaveStringShorterThan(key: string, other: string, expectationFailOutput?: any): boolean;
toHaveTrue(key: string, expectationFailOutput?: any): boolean;
toHaveWhitespaceString(key: string, expectationFailOutput?: any): boolean;
toHaveWholeNumber(key: string, expectationFailOutput?: any): boolean;

toImplement(api: {}, expectationFailOutput?: any): boolean;

toStartWith(subString: string, expectationFailOutput?: any): boolean;

toThrowAnyError(expectationFailOutput?: any): boolean;
toThrowErrorOfType(type: string, expectationFailOutput?: any): boolean;
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"test:local": "karma start karma/base.conf.js --browsers Chrome",
"watch": "gulp watch"
},
"types": "./jasmine-matchers.d.ts",
"xo": {
"envs": [
"jasmine",
Expand Down

0 comments on commit 105bcc3

Please sign in to comment.