@wordpress/jest-console 5.1.0 → 5.2.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.
Files changed (2) hide show
  1. package/package.json +4 -3
  2. package/types/index.d.ts +46 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/jest-console",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Custom Jest matchers for the Console object.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -25,7 +25,8 @@
25
25
  },
26
26
  "files": [
27
27
  "build",
28
- "build-module"
28
+ "build-module",
29
+ "types"
29
30
  ],
30
31
  "main": "build/index.js",
31
32
  "module": "build-module/index.js",
@@ -41,5 +42,5 @@
41
42
  "publishConfig": {
42
43
  "access": "public"
43
44
  },
44
- "gitHead": "198fa129cf1af8dc615918987ea6795cd40ab7df"
45
+ "gitHead": "a3e0b62091e8a8bdf5e2518e42d60d7098af48cc"
45
46
  }
@@ -0,0 +1,46 @@
1
+ // Definitions originally written by Damien Sorel <https://github.com/mistic100> under MIT license.
2
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/f0b72c12f6b561e4342dc8a1cf87432d2ad40ae7/types/wordpress__jest-console/index.d.ts
3
+
4
+ declare namespace jest {
5
+ interface Matchers< R, T > {
6
+ /**
7
+ * Ensure that `console.error` function was called.
8
+ */
9
+ toHaveErrored(): R;
10
+
11
+ /**
12
+ * Ensure that `console.error` function was called with specific arguments.
13
+ */
14
+ toHaveErroredWith( ...args: any[] ): R;
15
+
16
+ /**
17
+ * Ensure that `console.info` function was called.
18
+ */
19
+ toHaveInformed(): R;
20
+
21
+ /**
22
+ * Ensure that `console.info` function was called with specific arguments.
23
+ */
24
+ toHaveInformedWith( ...args: any[] ): R;
25
+
26
+ /**
27
+ * Ensure that `console.log` function was called.
28
+ */
29
+ toHaveLogged(): R;
30
+
31
+ /**
32
+ * Ensure that `console.log` function was called with specific arguments.
33
+ */
34
+ toHaveLoggedWith( ...args: any[] ): R;
35
+
36
+ /**
37
+ * Ensure that `console.warn` function was called.
38
+ */
39
+ toHaveWarned(): R;
40
+
41
+ /**
42
+ * Ensure that `console.warn` function was called with specific arguments.
43
+ */
44
+ toHaveWarnedWith( ...args: any[] ): R;
45
+ }
46
+ }