@sprucelabs/test-utils 3.2.108 → 3.3.0

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.
@@ -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;
@@ -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(test, Test) {
227
+ assert.isTrue(test instanceof Test);
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;
@@ -229,5 +229,8 @@ const assert = {
229
229
  });
230
230
  },
231
231
  fail: assertUtil.fail,
232
+ isInstanceOf(test, Test) {
233
+ assert.isTrue(test instanceof Test);
234
+ },
232
235
  };
233
236
  export default assert;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.2.108",
6
+ "version": "3.3.0",
7
7
  "files": [
8
8
  "build"
9
9
  ],