@digitaldefiance/express-suite-test-utils 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -70,6 +70,10 @@ MIT
70
70
 
71
71
  ## ChangeLog
72
72
 
73
+ ### v1.0.3
74
+
75
+ - Add jest global declaration for toThrowType
76
+
73
77
  ### v1.0.2
74
78
 
75
79
  - Add LocalStorageMock
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/express-suite-test-utils",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Test utilities for Digital Defiance Express Suite",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -1,5 +1,12 @@
1
1
  import type { MatcherContext } from 'expect';
2
2
  export type ErrorClass<E extends Error> = new (...args: any[]) => E;
3
+ declare global {
4
+ namespace jest {
5
+ interface Matchers<R> {
6
+ toThrowType<E extends Error>(errorType: ErrorClass<E>, validator?: (error: E) => void): R;
7
+ }
8
+ }
9
+ }
3
10
  export declare const toThrowType: <E extends Error>(this: MatcherContext, received: (() => unknown | Promise<unknown>) | Promise<unknown>, errorType: ErrorClass<E>, validator?: (error: E) => void) => Promise<{
4
11
  pass: boolean;
5
12
  message: () => string;
@@ -1 +1 @@
1
- {"version":3,"file":"to-throw-type.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-test-utils/src/lib/to-throw-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAI7C,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAoDpE,eAAO,MAAM,WAAW,GAAmB,CAAC,SAAS,KAAK,EACxD,MAAM,cAAc,EACpB,UAAU,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,EAC/D,WAAW,UAAU,CAAC,CAAC,CAAC,EACxB,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAC7B,OAAO,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,MAAM,CAAA;CAAE,CA4HlD,CAAC"}
1
+ {"version":3,"file":"to-throw-type.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-test-utils/src/lib/to-throw-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAI7C,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEpE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,IAAI,CAAC;QACb,UAAU,QAAQ,CAAC,CAAC;YAClB,WAAW,CAAC,CAAC,SAAS,KAAK,EACzB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAC7B,CAAC,CAAC;SACN;KACF;CACF;AAoDD,eAAO,MAAM,WAAW,GAAmB,CAAC,SAAS,KAAK,EACxD,MAAM,cAAc,EACpB,UAAU,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,EAC/D,WAAW,UAAU,CAAC,CAAC,CAAC,EACxB,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAC7B,OAAO,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,MAAM,CAAA;CAAE,CA4HlD,CAAC"}