expect-more-jest
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -6,4 +6,4 @@ # Change Log | ||
<a name="2.2.0"></a> | ||
# [2.2.0](https://github.com/JamieMason/expect-more/compare/expect-more-jest@2.1.0...expect-more-jest@2.2.0) (2018-08-26) | ||
<a name="2.3.0"></a> | ||
# [2.3.0](https://github.com/JamieMason/expect-more/compare/expect-more-jest@2.2.0...expect-more-jest@2.3.0) (2018-08-26) | ||
@@ -13,3 +13,3 @@ | ||
* **jest:** display matcher documentation in intellisense ([6bae199](https://github.com/JamieMason/expect-more/commit/6bae199)) | ||
* **jest:** improve asymmetric matcher intellisense documentation ([a818b20](https://github.com/JamieMason/expect-more/commit/a818b20)) | ||
@@ -20,13 +20,18 @@ | ||
<a name="2.1.0"></a> | ||
# [2.1.0](https://github.com/JamieMason/expect-more/compare/expect-more-jest@2.0.0...expect-more-jest@2.1.0) (2018-08-25) | ||
<a name="2.2.0"></a> | ||
# [2.2.0](https://github.com/JamieMason/expect-more/compare/expect-more-jest@2.1.0...expect-more-jest@2.2.0) (2018-08-26) | ||
### Features | ||
* **jest:** add types for asymmetric matchers ([13fe78d](https://github.com/JamieMason/expect-more/commit/13fe78d)) | ||
- **jest:** display matcher documentation in intellisense | ||
([6bae199](https://github.com/JamieMason/expect-more/commit/6bae199)) | ||
<a name="2.1.0"></a> | ||
# [2.1.0](https://github.com/JamieMason/expect-more/compare/expect-more-jest@2.0.0...expect-more-jest@2.1.0) (2018-08-25) | ||
### Features | ||
- **jest:** add types for asymmetric matchers ([13fe78d](https://github.com/JamieMason/expect-more/commit/13fe78d)) | ||
@@ -33,0 +38,0 @@ <a name="2.0.0"></a> |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeAfter<T>(other: Date): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is a valid instance of `Date` whose value occurs after that of `other` Date. | ||
* @example | ||
* expect(game.releaseDate).toBeAfter(new Date('1990-10-15')); | ||
* @example | ||
* expect(game.releaseDate).toEqual(expect.toBeAfter(new Date('1990-10-15'))); | ||
* @example | ||
* expect(game).toEqual( | ||
* expect.objectContaining({ | ||
* releaseDate: expect.toBeAfter(new Date('1990-10-15')) | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toBeAfter<T>(other: Date): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a valid instance of `Date` whose value occurs after that of `other` Date. | ||
* @param other | ||
* @example | ||
* expect(game.releaseDate).toBeAfter(new Date('1990-10-15')); | ||
*/ | ||
toBeAfter(other: Date): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeArrayOfBooleans<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `Boolean` values. | ||
* @example | ||
* expect(player.attempts).toBeArrayOfBooleans(); | ||
* @example | ||
* expect(player.attempts).toEqual(expect.toBeArrayOfBooleans()); | ||
* @example | ||
* expect(player).toEqual( | ||
* expect.objectContaining({ | ||
* attempts: expect.toBeArrayOfBooleans() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeArrayOfBooleans<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `Boolean` values. | ||
* @example | ||
* expect(player.attempts).toBeArrayOfBooleans(); | ||
*/ | ||
toBeArrayOfBooleans(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeArrayOfNumbers<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `Number` values. | ||
* @example | ||
* expect(player.highScores).toBeArrayOfNumbers(); | ||
* @example | ||
* expect(player.highScores).toEqual(expect.toBeArrayOfNumbers()); | ||
* @example | ||
* expect(player).toEqual( | ||
* expect.objectContaining({ | ||
* highScores: expect.toBeArrayOfNumbers() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeArrayOfNumbers<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `Number` values. | ||
* @example | ||
* expect(player.highScores).toBeArrayOfNumbers(); | ||
*/ | ||
toBeArrayOfNumbers(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeArrayOfObjects<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `Object` values. | ||
* @example | ||
* expect(team.members).toBeArrayOfObjects(); | ||
* @example | ||
* expect(team.members).toEqual(expect.toBeArrayOfObjects()); | ||
* @example | ||
* expect(team).toEqual( | ||
* expect.objectContaining({ | ||
* members: expect.toBeArrayOfObjects() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeArrayOfObjects<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `Object` values. | ||
* @example | ||
* expect(team.members).toBeArrayOfObjects(); | ||
*/ | ||
toBeArrayOfObjects(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeArrayOfSize<T>(size: number): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is an `Array` containing `size` number of values. | ||
* @example | ||
* expect(cat.paws).toBeArrayOfSize(4); | ||
* @example | ||
* expect(cat.paws).toEqual(expect.toBeArrayOfSize(4)); | ||
* @example | ||
* expect(cat).toEqual( | ||
* expect.objectContaining({ | ||
* paws: expect.toBeArrayOfSize(4) | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toBeArrayOfSize<T>(size: number): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing `size` number of values. | ||
* @param size | ||
* @example | ||
* expect(cat.paws).toBeArrayOfSize(4); | ||
*/ | ||
toBeArrayOfSize(size: number): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeArrayOfStrings<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `String` values. | ||
* @example | ||
* expect(player.messages).toBeArrayOfStrings(); | ||
* @example | ||
* expect(player.messages).toEqual(expect.toBeArrayOfStrings()); | ||
* @example | ||
* expect(player).toEqual( | ||
* expect.objectContaining({ | ||
* messages: expect.toBeArrayOfStrings() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeArrayOfStrings<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing only `String` values. | ||
* @example | ||
* expect(player.messages).toBeArrayOfStrings(); | ||
*/ | ||
toBeArrayOfStrings(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a valid `Array` containing none or any number of items of any type. | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* messages: expect.toBeArray() | ||
* }) | ||
* ); | ||
*/ | ||
toBeArray<T>(): Matchers<T>; | ||
@@ -5,0 +14,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeBefore<T>(other: Date): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is a valid instance of `Date` whose value occurs before that of `other` Date. | ||
* @example | ||
* expect(game.releaseDate).toBeBefore(new Date('1990-10-15')); | ||
* @example | ||
* expect(game.releaseDate).toEqual(expect.toBeBefore(new Date('1990-10-15'))); | ||
* @example | ||
* expect(game).toEqual( | ||
* expect.objectContaining({ | ||
* releaseDate: expect.toBeBefore(new Date('1990-10-15')) | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toBeBefore<T>(other: Date): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a valid instance of `Date` whose value occurs before that of `other` Date. | ||
* @param other | ||
* @example | ||
* expect(game.releaseDate).toBeBefore(new Date('1990-10-15')); | ||
*/ | ||
toBeBefore(other: Date): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a `true`, `false`, `new Boolean(true)`, or `new Boolean(false)`. | ||
* @param divisor | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* isActive: expect.toBeBoolean() | ||
* }) | ||
* ); | ||
*/ | ||
toBeBoolean<T>(): Matchers<T>; | ||
@@ -5,0 +15,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeCalculable<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Assert subject can be used in Mathemetic calculations despite not being a `Number`, | ||
* @example | ||
* expect(ageField.value).toBeCalculable(); | ||
* @example | ||
* expect(ageField.value).toEqual(expect.toBeCalculable()); | ||
* @example | ||
* expect(team).toEqual( | ||
* expect.objectContaining({ | ||
* ageField: expect.toBeCalculable() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onSubmit).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toBeCalculable<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Assert subject can be used in Mathemetic calculations despite not being a `Number`, | ||
* for example `"1" * "2" === 2` whereas `"wut?" * 2 === NaN`. | ||
* @example | ||
* expect(ageField.value).toBeCalculable(); | ||
*/ | ||
toBeCalculable(): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is an instance of `Date`. | ||
* @example | ||
* expect(onSubmit).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* releaseDate: expect.toBeDate() | ||
* }) | ||
* ); | ||
*/ | ||
toBeDate<T>(): Matchers<T>; | ||
@@ -5,0 +14,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeDivisibleBy<T>(ber: any, divisor: any): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is a `Number` divisible by `other` number. | ||
* @example | ||
* expect(cat.paws).toBeDivisibleBy(2); | ||
* @example | ||
* expect(cat.paws).toEqual(expect.toBeDivisibleBy(2)); | ||
* @example | ||
* expect(cat).toEqual( | ||
* expect.objectContaining({ | ||
* paws: expect.toBeDivisibleBy(2) | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toBeDivisibleBy<T>(ber: any, divisor: any): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `Number` divisible by `other` number. | ||
* @param divisor | ||
* @example | ||
* expect(cat.paws).toBeDivisibleBy(2); | ||
*/ | ||
toBeDivisibleBy(ber: any, divisor: any): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a valid `Array` containing no items. | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* messages: expect.toBeEmptyArray() | ||
* }) | ||
* ); | ||
*/ | ||
toBeEmptyArray<T>(): Matchers<T>; | ||
@@ -5,0 +14,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a valid `Object` containing no members. | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* byId: expect.toBeEmptyObject() | ||
* }) | ||
* ); | ||
*/ | ||
toBeEmptyObject<T>(): Matchers<T>; | ||
@@ -10,3 +19,3 @@ } | ||
* @example | ||
* expect(openIssues.ById).toBeEmptyObject(); | ||
* expect(openIssues.byId).toBeEmptyObject(); | ||
*/ | ||
@@ -13,0 +22,0 @@ toBeEmptyObject(): R; |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a valid `String` containing no characters. | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* nickname: expect.toBeEmptyString() | ||
* }) | ||
* ); | ||
*/ | ||
toBeEmptyString<T>(): Matchers<T>; | ||
@@ -5,0 +14,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeEvenNumber<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an even `Number`. | ||
* @example | ||
* expect(parallelogram.sides).toBeEvenNumber(); | ||
* @example | ||
* expect(parallelogram.sides).toEqual(expect.toBeEvenNumber()); | ||
* @example | ||
* expect(parallelogram).toEqual( | ||
* expect.objectContaining({ | ||
* sides: expect.toBeEvenNumber() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeEvenNumber<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an even `Number`. | ||
* @example | ||
* expect(parallelogram.sides).toBeEvenNumber(); | ||
*/ | ||
toBeEvenNumber(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a `false` or `new Boolean(false)`. | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* isActive: expect.toBeFalse() | ||
* }) | ||
* ); | ||
*/ | ||
toBeFalse<T>(): Matchers<T>; | ||
@@ -5,0 +14,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a `Function`. | ||
* @param other | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* shoot: expect.toBeFunction() | ||
* }) | ||
* ); | ||
*/ | ||
toBeFunction<T>(): Matchers<T>; | ||
@@ -5,0 +15,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeIso8601<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a String which conforms to common use-cases of the ISO 8601 standard | ||
* representation of dates and times. | ||
* Asserts that a value is a String which conforms to common use-cases of the ISO 8601 standard representation of | ||
* dates and times. | ||
* @example | ||
* expect(log.timestamp).toBeIso8601(); | ||
* @example | ||
* expect(log.timestamp).toEqual(expect.toBeIso8601()); | ||
@@ -27,2 +22,11 @@ * @example | ||
*/ | ||
toBeIso8601<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a String which conforms to common use-cases of the ISO 8601 standard representation of | ||
* dates and times. | ||
* @example | ||
* expect(log.timestamp).toBeIso8601(); | ||
*/ | ||
toBeIso8601(): R; | ||
@@ -29,0 +33,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeJsonString<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` of valid [JSON][json]. | ||
* Asserts that a value is a `String` of valid JSON. | ||
* @example | ||
* expect(response.body).toBeJsonString(); | ||
* @example | ||
* expect(response.body).toEqual(expect.toBeJsonString()); | ||
@@ -25,4 +20,11 @@ * @example | ||
* ); | ||
* [json]: https://en.wikipedia.org/wiki/JSON | ||
*/ | ||
toBeJsonString<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` of valid JSON. | ||
* @example | ||
* expect(response.body).toBeJsonString(); | ||
*/ | ||
toBeJsonString(): R; | ||
@@ -29,0 +31,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeLongerThan<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,4 +8,2 @@ * Asserts that a value is a `String` or `Array` whose length is greater than `other`. | ||
* @example | ||
* expect(appendedFile.contents).toBeLongerThan(file.contents); | ||
* @example | ||
* expect(appendedFile.contents).toEqual(expect.toBeLongerThan(file.contents)); | ||
@@ -28,2 +23,11 @@ * @example | ||
*/ | ||
toBeLongerThan<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` or `Array` whose length is greater than `other`. | ||
* @param other | ||
* @example | ||
* expect(appendedFile.contents).toBeLongerThan(file.contents); | ||
*/ | ||
toBeLongerThan(other: string): R; | ||
@@ -30,0 +34,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeNonEmptyArray<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing at least 1 value. | ||
* @example | ||
* expect(basket.items).toBeNonEmptyArray(); | ||
* @example | ||
* expect(basket.items).toEqual(expect.toBeNonEmptyArray()); | ||
* @example | ||
* expect(basket).toEqual( | ||
* expect.objectContaining({ | ||
* items: expect.toBeNonEmptyArray() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeNonEmptyArray<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Array` containing at least 1 value. | ||
* @example | ||
* expect(basket.items).toBeNonEmptyArray(); | ||
*/ | ||
toBeNonEmptyArray(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeNonEmptyObject<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Object` containing at least 1 member. | ||
* @example | ||
* expect(activeUsers.byId).toBeNonEmptyObject(); | ||
* @example | ||
* expect(activeUsers.byId).toEqual(expect.toBeNonEmptyObject()); | ||
* @example | ||
* expect(activeUsers).toEqual( | ||
* expect.objectContaining({ | ||
* byId: expect.toBeNonEmptyObject() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeNonEmptyObject<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an `Object` containing at least 1 member. | ||
* @example | ||
* expect(activeUsers.byId).toBeNonEmptyObject(); | ||
*/ | ||
toBeNonEmptyObject(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeNonEmptyString<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a valid `String` containing at least one character. | ||
* @example | ||
* expect(passwordField.value).toBeNonEmptyString(); | ||
* @example | ||
* expect(player.name).toEqual(expect.toBeNonEmptyString()); | ||
* @example | ||
* expect(player).toEqual( | ||
* expect.objectContaining({ | ||
* name: expect.toBeNonEmptyString() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeNonEmptyString<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a valid `String` containing at least one character. | ||
* @example | ||
* expect(passwordField.value).toBeNonEmptyString(); | ||
*/ | ||
toBeNonEmptyString(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a valid `Number` or `new Number()` and not `NaN`. | ||
* @param other | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* age: expect.toBeNumber() | ||
* }) | ||
* ); | ||
*/ | ||
toBeNumber<T>(): Matchers<T>; | ||
@@ -8,3 +18,3 @@ } | ||
/** | ||
* Asserts that a value is a valid `Number` and not `NaN`. | ||
* Asserts that a value is a valid `Number` or `new Number()` and not `NaN`. | ||
* @example | ||
@@ -11,0 +21,0 @@ * expect(player.age).toBeNumber(); |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is an `Object`. | ||
* @param other | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* player: expect.toBeObject() | ||
* }) | ||
* ); | ||
*/ | ||
toBeObject<T>(): Matchers<T>; | ||
@@ -5,0 +15,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeOddNumber<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an odd `Number`. | ||
* @example | ||
* expect(triangle.sides).toBeOddNumber(); | ||
* @example | ||
* expect(triangle.sides).toEqual(expect.toBeOddNumber()); | ||
* @example | ||
* expect(triangle).toEqual( | ||
* expect.objectContaining({ | ||
* sides: expect.toBeOddNumber() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeOddNumber<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an odd `Number`. | ||
* @example | ||
* expect(triangle.sides).toBeOddNumber(); | ||
*/ | ||
toBeOddNumber(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a regular expression. | ||
* @param other | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* pattern: expect.toBeRegExp() | ||
* }) | ||
* ); | ||
*/ | ||
toBeRegExp<T>(): Matchers<T>; | ||
@@ -5,0 +15,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeSameLengthAs<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is a `String` or `Array` whose length is the same as `other`. | ||
* @example | ||
* expect(passwordField.value).toBeSameLengthAs(requirements.passwordLength); | ||
* @example | ||
* expect(passwordField.value).toEqual(expect.toBeSameLengthAs(requirements.passwordLength)); | ||
* @example | ||
* expect(passwordField).toEqual( | ||
* expect.objectContaining({ | ||
* value: expect.toBeSameLengthAs(requirements.passwordLength) | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toBeSameLengthAs<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` or `Array` whose length is the same as `other`. | ||
* @param other | ||
* @example | ||
* expect(passwordField.value).toBeSameLengthAs(requirements.passwordLength); | ||
*/ | ||
toBeSameLengthAs(other: string): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeShorterThan<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is a `String` or `Array` whose length is less than `other`. | ||
* @example | ||
* expect(truncatedFile.contents).toBeShorterThan(file.contents); | ||
* @example | ||
* expect(truncatedFile.contents).toEqual(expect.toBeShorterThan(file.contents)); | ||
* @example | ||
* expect(truncatedFile).toEqual( | ||
* expect.objectContaining({ | ||
* contents: expect.toBeShorterThan(file.contents) | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toBeShorterThan<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` or `Array` whose length is less than `other`. | ||
* @param other | ||
* @example | ||
* expect(truncatedFile.contents).toBeShorterThan(file.contents); | ||
*/ | ||
toBeShorterThan(other: string): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a `String` or `new String()`. | ||
* @param other | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* name: expect.toBeString() | ||
* }) | ||
* ); | ||
*/ | ||
toBeString<T>(): Matchers<T>; | ||
@@ -8,3 +18,3 @@ } | ||
/** | ||
* Asserts that a value is a `String`. | ||
* Asserts that a value is a `String` or `new String()`. | ||
* @example | ||
@@ -11,0 +21,0 @@ * expect(player.name).toBeString(); |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
/** | ||
* Asserts that a value is a `true` or `new Boolean(true)`. | ||
* @param other | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
* expect.objectContaining({ | ||
* isActive: expect.toBeTrue() | ||
* }) | ||
* ); | ||
*/ | ||
toBeTrue<T>(): Matchers<T>; | ||
@@ -5,0 +15,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeValidDate<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -12,12 +9,2 @@ * Asserts that a value is an instance of `Date` whose _value_ is valid. `Date` is little like `Promise` in that | ||
* @example | ||
* expect(game.releaseDate).toBeValidDate(); | ||
* @example | ||
* expect(game.releaseDate).toEqual(expect.toBeValidDate()); | ||
* @example | ||
* expect(game).toEqual( | ||
* expect.objectContaining({ | ||
* releaseDate: expect.toBeValidDate() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -29,2 +16,12 @@ * expect.objectContaining({ | ||
*/ | ||
toBeValidDate<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is an instance of `Date` whose _value_ is valid. `Date` is little like `Promise` in that | ||
* it is a container for a value. `new Date('wut?')` for example, is a valid `Date` which wraps a value which is | ||
* _not_ valid. | ||
* @example | ||
* expect(game.releaseDate).toBeValidDate(); | ||
*/ | ||
toBeValidDate(): R; | ||
@@ -31,0 +28,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeWhitespace<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` containing only whitespace characters. | ||
* @example | ||
* expect(htmlMinify.dataRemoved).toBeWhitespace(); | ||
* @example | ||
* expect(htmlMinify.dataRemoved).toEqual(expect.toBeWhitespace()); | ||
* @example | ||
* expect(htmlMinify).toEqual( | ||
* expect.objectContaining({ | ||
* dataRemoved: expect.toBeWhitespace() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeWhitespace<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` containing only whitespace characters. | ||
* @example | ||
* expect(htmlMinify.dataRemoved).toBeWhitespace(); | ||
*/ | ||
toBeWhitespace(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toBeWholeNumber<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `Number` with no positive decimal places. | ||
* @example | ||
* expect(player.livesRemaining).toBeWholeNumber(); | ||
* @example | ||
* expect(player.livesRemaining).toEqual(expect.toBeWholeNumber()); | ||
* @example | ||
* expect(player).toEqual( | ||
* expect.objectContaining({ | ||
* livesRemaining: expect.toBeWholeNumber() | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -26,2 +13,10 @@ * expect.objectContaining({ | ||
*/ | ||
toBeWholeNumber<T>(): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `Number` with no positive decimal places. | ||
* @example | ||
* expect(player.livesRemaining).toBeWholeNumber(); | ||
*/ | ||
toBeWholeNumber(): R; | ||
@@ -28,0 +23,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toEndWith<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is a `String` whose trailing characters are `other` string. | ||
* @example | ||
* expect(tvChannel.name).toEndWith(' HD'); | ||
* @example | ||
* expect(tvChannel.name).toEqual(expect.toEndWith(' HD')); | ||
* @example | ||
* expect(tvChannel).toEqual( | ||
* expect.objectContaining({ | ||
* name: expect.toEndWith(' HD') | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toEndWith<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` whose trailing characters are `other` string. | ||
* @param other | ||
* @example | ||
* expect(tvChannel.name).toEndWith(' HD'); | ||
*/ | ||
toEndWith(other: string): R; | ||
@@ -30,0 +26,0 @@ } |
declare global { | ||
namespace jest { | ||
interface Expect { | ||
toStartWith<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
@@ -11,12 +8,2 @@ * Asserts that a value is a `String` whose leading characters are `other` string. | ||
* @example | ||
* expect(location.postcode).toStartWith('LS1'); | ||
* @example | ||
* expect(location.postcode).toEqual(expect.toStartWith('LS1')); | ||
* @example | ||
* expect(location).toEqual( | ||
* expect.objectContaining({ | ||
* postcode: expect.toStartWith('LS1') | ||
* }) | ||
* ); | ||
* @example | ||
* expect(onPress).toHaveBeenCalledWith( | ||
@@ -28,2 +15,11 @@ * expect.objectContaining({ | ||
*/ | ||
toStartWith<T>(other: string): Matchers<T>; | ||
} | ||
interface Matchers<R> { | ||
/** | ||
* Asserts that a value is a `String` whose leading characters are `other` string. | ||
* @param other | ||
* @example | ||
* expect(location.postcode).toStartWith('LS1'); | ||
*/ | ||
toStartWith(other: string): R; | ||
@@ -30,0 +26,0 @@ } |
{ | ||
"name": "expect-more-jest", | ||
"description": "Write Beautiful Specs with Custom Matchers", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)", | ||
@@ -12,3 +12,3 @@ "bugs": "https://github.com/JamieMason/expect-more/issues", | ||
"chalk": "2.4.1", | ||
"expect-more": "0.5.2", | ||
"expect-more": "0.5.3", | ||
"jest-matcher-utils": "23.5.0" | ||
@@ -15,0 +15,0 @@ }, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
95584
2204
0
+ Addedexpect-more@0.5.3(transitive)
- Removedexpect-more@0.5.2(transitive)
Updatedexpect-more@0.5.3