@sprucelabs/test-utils 3.2.108 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/assert/assert.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ type IsAny<T> = IfAny<T, true, never>;
|
|
|
7
7
|
type TypeEqual<T, U> = IsAny<T> extends never ? Exclude<T, U> extends never ? Exclude<U, T> extends never ? true : false : false : false;
|
|
8
8
|
declare function isExactType<T, E, Pass = TypeEqual<T, E>>(_: Pass): void;
|
|
9
9
|
export interface ISpruceAssert {
|
|
10
|
+
isInstanceOf<T>(test: T, Test: new (...props: any[]) => T): void;
|
|
10
11
|
isNumber(actual: any, message?: string): asserts actual is number;
|
|
11
12
|
isType: typeof expectType;
|
|
12
13
|
isExactType: typeof isExactType;
|
package/build/assert/assert.js
CHANGED
|
@@ -223,5 +223,8 @@ const assert = {
|
|
|
223
223
|
this.fail('Expected a thrown error, but never got one!');
|
|
224
224
|
},
|
|
225
225
|
fail: assert_utility_1.default.fail,
|
|
226
|
+
isInstanceOf(actual, Class) {
|
|
227
|
+
assert.isTrue(actual instanceof Class, `actual is not an instance of:\n\n${Class}`);
|
|
228
|
+
},
|
|
226
229
|
};
|
|
227
230
|
exports.default = assert;
|
|
@@ -7,6 +7,7 @@ type IsAny<T> = IfAny<T, true, never>;
|
|
|
7
7
|
type TypeEqual<T, U> = IsAny<T> extends never ? Exclude<T, U> extends never ? Exclude<U, T> extends never ? true : false : false : false;
|
|
8
8
|
declare function isExactType<T, E, Pass = TypeEqual<T, E>>(_: Pass): void;
|
|
9
9
|
export interface ISpruceAssert {
|
|
10
|
+
isInstanceOf<T>(test: T, Test: new (...props: any[]) => T): void;
|
|
10
11
|
isNumber(actual: any, message?: string): asserts actual is number;
|
|
11
12
|
isType: typeof expectType;
|
|
12
13
|
isExactType: typeof isExactType;
|