@wordpress/jest-console 8.32.0 → 8.32.1-next.ff1cebbba.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.
- package/build/declarations.d.js +1 -1
- package/build/declarations.d.js.map +7 -1
- package/build/index.js +27 -24
- package/build/index.js.map +7 -1
- package/build/matchers.js +61 -33
- package/build/matchers.js.map +7 -1
- package/build/supported-matchers.js +27 -10
- package/build/supported-matchers.js.map +7 -1
- package/build/types.js +16 -5
- package/build/types.js.map +7 -1
- package/build-module/declarations.d.js +1 -2
- package/build-module/declarations.d.js.map +7 -1
- package/build-module/index.js +4 -20
- package/build-module/index.js.map +7 -1
- package/build-module/matchers.js +40 -31
- package/build-module/matchers.js.map +7 -1
- package/build-module/supported-matchers.js +9 -6
- package/build-module/supported-matchers.js.map +7 -1
- package/build-module/types.js +1 -2
- package/build-module/types.js.map +7 -1
- package/package.json +10 -3
package/build/declarations.d.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
//# sourceMappingURL=declarations.d.js.map
|
|
2
|
+
//# sourceMappingURL=declarations.d.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/index.js
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_matchers = require("./matchers");
|
|
25
|
+
var import_supported_matchers = __toESM(require("./supported-matchers"));
|
|
26
|
+
const setConsoleMethodSpy = (args) => {
|
|
16
27
|
const [methodName, matcherName] = args;
|
|
17
28
|
const spy = jest.spyOn(console, methodName).mockName(`console.${methodName}`);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Resets the spy to its initial state.
|
|
21
|
-
*/
|
|
22
29
|
function resetSpy() {
|
|
23
30
|
spy.mockReset();
|
|
24
31
|
spy.assertionsNumber = 0;
|
|
25
32
|
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Verifies that the spy has only been called if expected.
|
|
29
|
-
*/
|
|
30
33
|
function assertExpectedCalls() {
|
|
31
34
|
if (spy.assertionsNumber === 0 && spy.mock.calls.length > 0) {
|
|
32
35
|
expect(console).not[matcherName]();
|
|
@@ -39,5 +42,5 @@ const setConsoleMethodSpy = args => {
|
|
|
39
42
|
});
|
|
40
43
|
afterEach(assertExpectedCalls);
|
|
41
44
|
};
|
|
42
|
-
Object.entries(
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
45
|
+
Object.entries(import_supported_matchers.default).forEach(setConsoleMethodSpy);
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport './matchers';\nimport supportedMatchers from './supported-matchers';\nimport type { ExtendedMock } from './types';\n\n/**\n * Sets spy on the console object's method to make it possible to fail test when method called without assertion.\n *\n * @param args\n */\nconst setConsoleMethodSpy = ( args: [ string, string ] ) => {\n\tconst [ methodName, matcherName ] = args;\n\tconst spy = jest\n\t\t.spyOn( console, methodName as 'error' | 'info' | 'log' | 'warn' )\n\t\t.mockName( `console.${ methodName }` ) as ExtendedMock;\n\n\t/**\n\t * Resets the spy to its initial state.\n\t */\n\tfunction resetSpy() {\n\t\tspy.mockReset();\n\t\tspy.assertionsNumber = 0;\n\t}\n\n\t/**\n\t * Verifies that the spy has only been called if expected.\n\t */\n\tfunction assertExpectedCalls() {\n\t\tif ( spy.assertionsNumber === 0 && spy.mock.calls.length > 0 ) {\n\t\t\texpect( console ).not[ matcherName ]();\n\t\t}\n\t}\n\n\tbeforeAll( resetSpy );\n\n\tbeforeEach( () => {\n\t\tassertExpectedCalls();\n\t\tresetSpy();\n\t} );\n\n\tafterEach( assertExpectedCalls );\n};\n\nObject.entries( supportedMatchers ).forEach( setConsoleMethodSpy );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAGA,sBAAO;AACP,gCAA8B;AAQ9B,MAAM,sBAAsB,CAAE,SAA8B;AAC3D,QAAM,CAAE,YAAY,WAAY,IAAI;AACpC,QAAM,MAAM,KACV,MAAO,SAAS,UAAgD,EAChE,SAAU,WAAY,UAAW,EAAG;AAKtC,WAAS,WAAW;AACnB,QAAI,UAAU;AACd,QAAI,mBAAmB;AAAA,EACxB;AAKA,WAAS,sBAAsB;AAC9B,QAAK,IAAI,qBAAqB,KAAK,IAAI,KAAK,MAAM,SAAS,GAAI;AAC9D,aAAQ,OAAQ,EAAE,IAAK,WAAY,EAAE;AAAA,IACtC;AAAA,EACD;AAEA,YAAW,QAAS;AAEpB,aAAY,MAAM;AACjB,wBAAoB;AACpB,aAAS;AAAA,EACV,CAAE;AAEF,YAAW,mBAAoB;AAChC;AAEA,OAAO,QAAS,0BAAAA,OAAkB,EAAE,QAAS,mBAAoB;",
|
|
6
|
+
"names": ["supportedMatchers"]
|
|
7
|
+
}
|
package/build/matchers.js
CHANGED
|
@@ -1,28 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var import_jest_matcher_utils = require("jest-matcher-utils");
|
|
25
|
+
var import_supported_matchers = __toESM(require("./supported-matchers"));
|
|
26
|
+
const createErrorMessage = (spyInfo) => {
|
|
27
|
+
const { spy, pass, calls, matcherName, methodName, expected } = spyInfo;
|
|
28
|
+
const hint = pass ? `.not${matcherName}` : matcherName;
|
|
29
|
+
const message = pass ? `Expected mock function not to be called but it was called with:
|
|
30
|
+
${calls.map(
|
|
31
|
+
import_jest_matcher_utils.printReceived
|
|
32
|
+
)}` : `Expected mock function to be called${expected ? ` with:
|
|
33
|
+
${(0, import_jest_matcher_utils.printExpected)(expected)}
|
|
34
|
+
` : "."}
|
|
35
|
+
but it was called with:
|
|
36
|
+
${calls.map(import_jest_matcher_utils.printReceived)}`;
|
|
37
|
+
return () => `${(0, import_jest_matcher_utils.matcherHint)(hint, spy.getMockName())}
|
|
2
38
|
|
|
3
|
-
|
|
4
|
-
var _jestMatcherUtils = require("jest-matcher-utils");
|
|
5
|
-
var _supportedMatchers = _interopRequireDefault(require("./supported-matchers"));
|
|
6
|
-
/**
|
|
7
|
-
* External dependencies
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
39
|
+
` + message + `
|
|
13
40
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
spy,
|
|
17
|
-
pass,
|
|
18
|
-
calls,
|
|
19
|
-
matcherName,
|
|
20
|
-
methodName,
|
|
21
|
-
expected
|
|
22
|
-
} = spyInfo;
|
|
23
|
-
const hint = pass ? `.not${matcherName}` : matcherName;
|
|
24
|
-
const message = pass ? `Expected mock function not to be called but it was called with:\n${calls.map(_jestMatcherUtils.printReceived)}` : `Expected mock function to be called${expected ? ` with:\n${(0, _jestMatcherUtils.printExpected)(expected)}\n` : '.'}\nbut it was called with:\n${calls.map(_jestMatcherUtils.printReceived)}`;
|
|
25
|
-
return () => `${(0, _jestMatcherUtils.matcherHint)(hint, spy.getMockName())}` + '\n\n' + message + '\n\n' + `console.${methodName}() should not be used unless explicitly expected\n` + 'See https://www.npmjs.com/package/@wordpress/jest-console for details.';
|
|
41
|
+
console.${methodName}() should not be used unless explicitly expected
|
|
42
|
+
See https://www.npmjs.com/package/@wordpress/jest-console for details.`;
|
|
26
43
|
};
|
|
27
44
|
const createSpyInfo = (spy, matcherName, methodName, expected) => {
|
|
28
45
|
const calls = spy.mock.calls;
|
|
@@ -40,24 +57,35 @@ const createSpyInfo = (spy, matcherName, methodName, expected) => {
|
|
|
40
57
|
message
|
|
41
58
|
};
|
|
42
59
|
};
|
|
43
|
-
const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
|
|
60
|
+
const createToHaveBeenCalledMatcher = (matcherName, methodName) => (received) => {
|
|
44
61
|
const spy = received[methodName];
|
|
45
62
|
const spyInfo = createSpyInfo(spy, matcherName, methodName);
|
|
46
63
|
spy.assertionsNumber += 1;
|
|
47
64
|
return spyInfo;
|
|
48
65
|
};
|
|
49
|
-
const createToHaveBeenCalledWith = (matcherName, methodName) => function
|
|
66
|
+
const createToHaveBeenCalledWith = (matcherName, methodName) => function(received, ...expected) {
|
|
50
67
|
const spy = received[methodName];
|
|
51
68
|
const spyInfo = createSpyInfo(spy, matcherName, methodName, expected);
|
|
52
69
|
spy.assertionsNumber += 1;
|
|
53
70
|
return spyInfo;
|
|
54
71
|
};
|
|
55
|
-
expect.extend(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
expect.extend(
|
|
73
|
+
Object.entries(import_supported_matchers.default).reduce(
|
|
74
|
+
(result, [methodName, matcherName]) => {
|
|
75
|
+
const matcherNameWith = `${matcherName}With`;
|
|
76
|
+
return {
|
|
77
|
+
...result,
|
|
78
|
+
[matcherName]: createToHaveBeenCalledMatcher(
|
|
79
|
+
`.${matcherName}`,
|
|
80
|
+
methodName
|
|
81
|
+
),
|
|
82
|
+
[matcherNameWith]: createToHaveBeenCalledWith(
|
|
83
|
+
`.${matcherNameWith}`,
|
|
84
|
+
methodName
|
|
85
|
+
)
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
{}
|
|
89
|
+
)
|
|
90
|
+
);
|
|
91
|
+
//# sourceMappingURL=matchers.js.map
|
package/build/matchers.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/matchers.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\nimport type { Mock } from 'jest-mock';\nimport type {\n\tExtendedMock,\n\tMatcherFunction,\n\tMatcherResult,\n\tMatcherWithArgsFunction,\n} from './types';\n\ninterface SpyInfo {\n\tspy: Mock;\n\tpass: boolean;\n\tcalls: unknown[][];\n\tmatcherName: string;\n\tmethodName: string;\n\texpected?: unknown[];\n}\n\nconst createErrorMessage = ( spyInfo: SpyInfo ) => {\n\tconst { spy, pass, calls, matcherName, methodName, expected } = spyInfo;\n\tconst hint = pass ? `.not${ matcherName }` : matcherName;\n\tconst message = pass\n\t\t? `Expected mock function not to be called but it was called with:\\n${ calls.map(\n\t\t\t\tprintReceived\n\t\t ) }`\n\t\t: `Expected mock function to be called${\n\t\t\t\texpected ? ` with:\\n${ printExpected( expected ) }\\n` : '.'\n\t\t }\\nbut it was called with:\\n${ calls.map( printReceived ) }`;\n\n\treturn () =>\n\t\t`${ matcherHint( hint, spy.getMockName() ) }` +\n\t\t'\\n\\n' +\n\t\tmessage +\n\t\t'\\n\\n' +\n\t\t`console.${ methodName }() should not be used unless explicitly expected\\n` +\n\t\t'See https://www.npmjs.com/package/@wordpress/jest-console for details.';\n};\n\nconst createSpyInfo = (\n\tspy: Mock,\n\tmatcherName: string,\n\tmethodName: string,\n\texpected?: unknown[]\n) => {\n\tconst calls = spy.mock.calls;\n\n\tconst pass = expected\n\t\t? JSON.stringify( calls ).includes( JSON.stringify( expected ) )\n\t\t: calls.length > 0;\n\n\tconst message = createErrorMessage( {\n\t\tspy,\n\t\tpass,\n\t\tcalls,\n\t\tmatcherName,\n\t\tmethodName,\n\t\texpected,\n\t} );\n\n\treturn {\n\t\tpass,\n\t\tmessage,\n\t};\n};\n\nconst createToHaveBeenCalledMatcher =\n\t( matcherName: string, methodName: string ) =>\n\t( received: Record< string, Mock > ): MatcherResult => {\n\t\tconst spy = received[ methodName ] as ExtendedMock;\n\t\tconst spyInfo = createSpyInfo( spy, matcherName, methodName );\n\t\tspy.assertionsNumber += 1;\n\t\treturn spyInfo;\n\t};\n\nconst createToHaveBeenCalledWith = (\n\tmatcherName: string,\n\tmethodName: string\n) =>\n\tfunction (\n\t\treceived: Record< string, Mock >,\n\t\t...expected: unknown[]\n\t): MatcherResult {\n\t\tconst spy = received[ methodName ] as ExtendedMock;\n\t\tconst spyInfo = createSpyInfo( spy, matcherName, methodName, expected );\n\t\tspy.assertionsNumber += 1;\n\t\treturn spyInfo;\n\t};\n\ntype MatchersObject = Record<\n\tstring,\n\tMatcherFunction | MatcherWithArgsFunction\n>;\n\nexpect.extend(\n\tObject.entries( supportedMatchers ).reduce< MatchersObject >(\n\t\t( result, [ methodName, matcherName ] ) => {\n\t\t\tconst matcherNameWith = `${ matcherName }With`;\n\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\t[ matcherName ]: createToHaveBeenCalledMatcher(\n\t\t\t\t\t`.${ matcherName }`,\n\t\t\t\t\tmethodName\n\t\t\t\t),\n\t\t\t\t[ matcherNameWith ]: createToHaveBeenCalledWith(\n\t\t\t\t\t`.${ matcherNameWith }`,\n\t\t\t\t\tmethodName\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t{}\n\t)\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAGA,gCAA0D;AAK1D,gCAA8B;AAkB9B,MAAM,qBAAqB,CAAE,YAAsB;AAClD,QAAM,EAAE,KAAK,MAAM,OAAO,aAAa,YAAY,SAAS,IAAI;AAChE,QAAM,OAAO,OAAO,OAAQ,WAAY,KAAK;AAC7C,QAAM,UAAU,OACb;AAAA,EAAqE,MAAM;AAAA,IAC3E;AAAA,EACA,CAAE,KACF,sCACA,WAAW;AAAA,MAAY,yCAAe,QAAS,CAAE;AAAA,IAAO,GACxD;AAAA;AAAA,EAA+B,MAAM,IAAK,uCAAc,CAAE;AAE7D,SAAO,MACN,OAAI,uCAAa,MAAM,IAAI,YAAY,CAAE,CAAE;AAAA;AAAA,IAE3C,UACA;AAAA;AAAA,UACY,UAAW;AAAA;AAEzB;AAEA,MAAM,gBAAgB,CACrB,KACA,aACA,YACA,aACI;AACJ,QAAM,QAAQ,IAAI,KAAK;AAEvB,QAAM,OAAO,WACV,KAAK,UAAW,KAAM,EAAE,SAAU,KAAK,UAAW,QAAS,CAAE,IAC7D,MAAM,SAAS;AAElB,QAAM,UAAU,mBAAoB;AAAA,IACnC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEA,MAAM,gCACL,CAAE,aAAqB,eACvB,CAAE,aAAqD;AACtD,QAAM,MAAM,SAAU,UAAW;AACjC,QAAM,UAAU,cAAe,KAAK,aAAa,UAAW;AAC5D,MAAI,oBAAoB;AACxB,SAAO;AACR;AAED,MAAM,6BAA6B,CAClC,aACA,eAEA,SACC,aACG,UACa;AAChB,QAAM,MAAM,SAAU,UAAW;AACjC,QAAM,UAAU,cAAe,KAAK,aAAa,YAAY,QAAS;AACtE,MAAI,oBAAoB;AACxB,SAAO;AACR;AAOD,OAAO;AAAA,EACN,OAAO,QAAS,0BAAAA,OAAkB,EAAE;AAAA,IACnC,CAAE,QAAQ,CAAE,YAAY,WAAY,MAAO;AAC1C,YAAM,kBAAkB,GAAI,WAAY;AAExC,aAAO;AAAA,QACN,GAAG;AAAA,QACH,CAAE,WAAY,GAAG;AAAA,UAChB,IAAK,WAAY;AAAA,UACjB;AAAA,QACD;AAAA,QACA,CAAE,eAAgB,GAAG;AAAA,UACpB,IAAK,eAAgB;AAAA,UACrB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACD;",
|
|
6
|
+
"names": ["supportedMatchers"]
|
|
7
|
+
}
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var supported_matchers_exports = {};
|
|
20
|
+
__export(supported_matchers_exports, {
|
|
21
|
+
default: () => supported_matchers_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
23
|
+
module.exports = __toCommonJS(supported_matchers_exports);
|
|
7
24
|
const supportedMatchers = {
|
|
8
|
-
error:
|
|
9
|
-
info:
|
|
10
|
-
log:
|
|
11
|
-
warn:
|
|
25
|
+
error: "toHaveErrored",
|
|
26
|
+
info: "toHaveInformed",
|
|
27
|
+
log: "toHaveLogged",
|
|
28
|
+
warn: "toHaveWarned"
|
|
12
29
|
};
|
|
13
|
-
var
|
|
14
|
-
//# sourceMappingURL=supported-matchers.js.map
|
|
30
|
+
var supported_matchers_default = supportedMatchers;
|
|
31
|
+
//# sourceMappingURL=supported-matchers.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/supported-matchers.ts"],
|
|
4
|
+
"sourcesContent": ["const supportedMatchers: Record< string, string > = {\n\terror: 'toHaveErrored',\n\tinfo: 'toHaveInformed',\n\tlog: 'toHaveLogged',\n\twarn: 'toHaveWarned',\n};\n\nexport default supportedMatchers;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,oBAA8C;AAAA,EACnD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AACP;AAEA,IAAO,6BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/types.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
package/build/types.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { Mock } from 'jest-mock';\n\n/**\n * Interface for the extended Jest Mock that includes the assertionsNumber property\n */\nexport interface ExtendedMock extends Mock {\n\tassertionsNumber: number;\n}\n\n/**\n * Interface for the matcher result object\n */\nexport interface MatcherResult {\n\tpass: boolean;\n\tmessage: () => string;\n}\n\n/**\n * Interface for the matcher function\n */\nexport type MatcherFunction = (\n\treceived: Record< string, Mock >\n) => MatcherResult;\n\n/**\n * Interface for the matcher function with arguments\n */\nexport type MatcherWithArgsFunction = (\n\treceived: Record< string, Mock >,\n\t...expected: unknown[]\n) => MatcherResult;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=declarations.d.js.map
|
|
1
|
+
//# sourceMappingURL=declarations.d.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/index.js
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './matchers';
|
|
5
|
-
import supportedMatchers from './supported-matchers';
|
|
6
|
-
/**
|
|
7
|
-
* Sets spy on the console object's method to make it possible to fail test when method called without assertion.
|
|
8
|
-
*
|
|
9
|
-
* @param args
|
|
10
|
-
*/
|
|
11
|
-
const setConsoleMethodSpy = args => {
|
|
1
|
+
import "./matchers";
|
|
2
|
+
import supportedMatchers from "./supported-matchers";
|
|
3
|
+
const setConsoleMethodSpy = (args) => {
|
|
12
4
|
const [methodName, matcherName] = args;
|
|
13
5
|
const spy = jest.spyOn(console, methodName).mockName(`console.${methodName}`);
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Resets the spy to its initial state.
|
|
17
|
-
*/
|
|
18
6
|
function resetSpy() {
|
|
19
7
|
spy.mockReset();
|
|
20
8
|
spy.assertionsNumber = 0;
|
|
21
9
|
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Verifies that the spy has only been called if expected.
|
|
25
|
-
*/
|
|
26
10
|
function assertExpectedCalls() {
|
|
27
11
|
if (spy.assertionsNumber === 0 && spy.mock.calls.length > 0) {
|
|
28
12
|
expect(console).not[matcherName]();
|
|
@@ -36,4 +20,4 @@ const setConsoleMethodSpy = args => {
|
|
|
36
20
|
afterEach(assertExpectedCalls);
|
|
37
21
|
};
|
|
38
22
|
Object.entries(supportedMatchers).forEach(setConsoleMethodSpy);
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport './matchers';\nimport supportedMatchers from './supported-matchers';\nimport type { ExtendedMock } from './types';\n\n/**\n * Sets spy on the console object's method to make it possible to fail test when method called without assertion.\n *\n * @param args\n */\nconst setConsoleMethodSpy = ( args: [ string, string ] ) => {\n\tconst [ methodName, matcherName ] = args;\n\tconst spy = jest\n\t\t.spyOn( console, methodName as 'error' | 'info' | 'log' | 'warn' )\n\t\t.mockName( `console.${ methodName }` ) as ExtendedMock;\n\n\t/**\n\t * Resets the spy to its initial state.\n\t */\n\tfunction resetSpy() {\n\t\tspy.mockReset();\n\t\tspy.assertionsNumber = 0;\n\t}\n\n\t/**\n\t * Verifies that the spy has only been called if expected.\n\t */\n\tfunction assertExpectedCalls() {\n\t\tif ( spy.assertionsNumber === 0 && spy.mock.calls.length > 0 ) {\n\t\t\texpect( console ).not[ matcherName ]();\n\t\t}\n\t}\n\n\tbeforeAll( resetSpy );\n\n\tbeforeEach( () => {\n\t\tassertExpectedCalls();\n\t\tresetSpy();\n\t} );\n\n\tafterEach( assertExpectedCalls );\n};\n\nObject.entries( supportedMatchers ).forEach( setConsoleMethodSpy );\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO;AACP,OAAO,uBAAuB;AAQ9B,MAAM,sBAAsB,CAAE,SAA8B;AAC3D,QAAM,CAAE,YAAY,WAAY,IAAI;AACpC,QAAM,MAAM,KACV,MAAO,SAAS,UAAgD,EAChE,SAAU,WAAY,UAAW,EAAG;AAKtC,WAAS,WAAW;AACnB,QAAI,UAAU;AACd,QAAI,mBAAmB;AAAA,EACxB;AAKA,WAAS,sBAAsB;AAC9B,QAAK,IAAI,qBAAqB,KAAK,IAAI,KAAK,MAAM,SAAS,GAAI;AAC9D,aAAQ,OAAQ,EAAE,IAAK,WAAY,EAAE;AAAA,IACtC;AAAA,EACD;AAEA,YAAW,QAAS;AAEpB,aAAY,MAAM;AACjB,wBAAoB;AACpB,aAAS;AAAA,EACV,CAAE;AAEF,YAAW,mBAAoB;AAChC;AAEA,OAAO,QAAS,iBAAkB,EAAE,QAAS,mBAAoB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/matchers.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import supportedMatchers from './supported-matchers';
|
|
10
|
-
const createErrorMessage = spyInfo => {
|
|
11
|
-
const {
|
|
12
|
-
spy,
|
|
13
|
-
pass,
|
|
14
|
-
calls,
|
|
15
|
-
matcherName,
|
|
16
|
-
methodName,
|
|
17
|
-
expected
|
|
18
|
-
} = spyInfo;
|
|
1
|
+
import { matcherHint, printExpected, printReceived } from "jest-matcher-utils";
|
|
2
|
+
import supportedMatchers from "./supported-matchers";
|
|
3
|
+
const createErrorMessage = (spyInfo) => {
|
|
4
|
+
const { spy, pass, calls, matcherName, methodName, expected } = spyInfo;
|
|
19
5
|
const hint = pass ? `.not${matcherName}` : matcherName;
|
|
20
|
-
const message = pass ? `Expected mock function not to be called but it was called with
|
|
21
|
-
|
|
6
|
+
const message = pass ? `Expected mock function not to be called but it was called with:
|
|
7
|
+
${calls.map(
|
|
8
|
+
printReceived
|
|
9
|
+
)}` : `Expected mock function to be called${expected ? ` with:
|
|
10
|
+
${printExpected(expected)}
|
|
11
|
+
` : "."}
|
|
12
|
+
but it was called with:
|
|
13
|
+
${calls.map(printReceived)}`;
|
|
14
|
+
return () => `${matcherHint(hint, spy.getMockName())}
|
|
15
|
+
|
|
16
|
+
` + message + `
|
|
17
|
+
|
|
18
|
+
console.${methodName}() should not be used unless explicitly expected
|
|
19
|
+
See https://www.npmjs.com/package/@wordpress/jest-console for details.`;
|
|
22
20
|
};
|
|
23
21
|
const createSpyInfo = (spy, matcherName, methodName, expected) => {
|
|
24
22
|
const calls = spy.mock.calls;
|
|
@@ -36,24 +34,35 @@ const createSpyInfo = (spy, matcherName, methodName, expected) => {
|
|
|
36
34
|
message
|
|
37
35
|
};
|
|
38
36
|
};
|
|
39
|
-
const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
|
|
37
|
+
const createToHaveBeenCalledMatcher = (matcherName, methodName) => (received) => {
|
|
40
38
|
const spy = received[methodName];
|
|
41
39
|
const spyInfo = createSpyInfo(spy, matcherName, methodName);
|
|
42
40
|
spy.assertionsNumber += 1;
|
|
43
41
|
return spyInfo;
|
|
44
42
|
};
|
|
45
|
-
const createToHaveBeenCalledWith = (matcherName, methodName) => function
|
|
43
|
+
const createToHaveBeenCalledWith = (matcherName, methodName) => function(received, ...expected) {
|
|
46
44
|
const spy = received[methodName];
|
|
47
45
|
const spyInfo = createSpyInfo(spy, matcherName, methodName, expected);
|
|
48
46
|
spy.assertionsNumber += 1;
|
|
49
47
|
return spyInfo;
|
|
50
48
|
};
|
|
51
|
-
expect.extend(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
expect.extend(
|
|
50
|
+
Object.entries(supportedMatchers).reduce(
|
|
51
|
+
(result, [methodName, matcherName]) => {
|
|
52
|
+
const matcherNameWith = `${matcherName}With`;
|
|
53
|
+
return {
|
|
54
|
+
...result,
|
|
55
|
+
[matcherName]: createToHaveBeenCalledMatcher(
|
|
56
|
+
`.${matcherName}`,
|
|
57
|
+
methodName
|
|
58
|
+
),
|
|
59
|
+
[matcherNameWith]: createToHaveBeenCalledWith(
|
|
60
|
+
`.${matcherNameWith}`,
|
|
61
|
+
methodName
|
|
62
|
+
)
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
{}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
//# sourceMappingURL=matchers.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/matchers.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\nimport type { Mock } from 'jest-mock';\nimport type {\n\tExtendedMock,\n\tMatcherFunction,\n\tMatcherResult,\n\tMatcherWithArgsFunction,\n} from './types';\n\ninterface SpyInfo {\n\tspy: Mock;\n\tpass: boolean;\n\tcalls: unknown[][];\n\tmatcherName: string;\n\tmethodName: string;\n\texpected?: unknown[];\n}\n\nconst createErrorMessage = ( spyInfo: SpyInfo ) => {\n\tconst { spy, pass, calls, matcherName, methodName, expected } = spyInfo;\n\tconst hint = pass ? `.not${ matcherName }` : matcherName;\n\tconst message = pass\n\t\t? `Expected mock function not to be called but it was called with:\\n${ calls.map(\n\t\t\t\tprintReceived\n\t\t ) }`\n\t\t: `Expected mock function to be called${\n\t\t\t\texpected ? ` with:\\n${ printExpected( expected ) }\\n` : '.'\n\t\t }\\nbut it was called with:\\n${ calls.map( printReceived ) }`;\n\n\treturn () =>\n\t\t`${ matcherHint( hint, spy.getMockName() ) }` +\n\t\t'\\n\\n' +\n\t\tmessage +\n\t\t'\\n\\n' +\n\t\t`console.${ methodName }() should not be used unless explicitly expected\\n` +\n\t\t'See https://www.npmjs.com/package/@wordpress/jest-console for details.';\n};\n\nconst createSpyInfo = (\n\tspy: Mock,\n\tmatcherName: string,\n\tmethodName: string,\n\texpected?: unknown[]\n) => {\n\tconst calls = spy.mock.calls;\n\n\tconst pass = expected\n\t\t? JSON.stringify( calls ).includes( JSON.stringify( expected ) )\n\t\t: calls.length > 0;\n\n\tconst message = createErrorMessage( {\n\t\tspy,\n\t\tpass,\n\t\tcalls,\n\t\tmatcherName,\n\t\tmethodName,\n\t\texpected,\n\t} );\n\n\treturn {\n\t\tpass,\n\t\tmessage,\n\t};\n};\n\nconst createToHaveBeenCalledMatcher =\n\t( matcherName: string, methodName: string ) =>\n\t( received: Record< string, Mock > ): MatcherResult => {\n\t\tconst spy = received[ methodName ] as ExtendedMock;\n\t\tconst spyInfo = createSpyInfo( spy, matcherName, methodName );\n\t\tspy.assertionsNumber += 1;\n\t\treturn spyInfo;\n\t};\n\nconst createToHaveBeenCalledWith = (\n\tmatcherName: string,\n\tmethodName: string\n) =>\n\tfunction (\n\t\treceived: Record< string, Mock >,\n\t\t...expected: unknown[]\n\t): MatcherResult {\n\t\tconst spy = received[ methodName ] as ExtendedMock;\n\t\tconst spyInfo = createSpyInfo( spy, matcherName, methodName, expected );\n\t\tspy.assertionsNumber += 1;\n\t\treturn spyInfo;\n\t};\n\ntype MatchersObject = Record<\n\tstring,\n\tMatcherFunction | MatcherWithArgsFunction\n>;\n\nexpect.extend(\n\tObject.entries( supportedMatchers ).reduce< MatchersObject >(\n\t\t( result, [ methodName, matcherName ] ) => {\n\t\t\tconst matcherNameWith = `${ matcherName }With`;\n\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\t[ matcherName ]: createToHaveBeenCalledMatcher(\n\t\t\t\t\t`.${ matcherName }`,\n\t\t\t\t\tmethodName\n\t\t\t\t),\n\t\t\t\t[ matcherNameWith ]: createToHaveBeenCalledWith(\n\t\t\t\t\t`.${ matcherNameWith }`,\n\t\t\t\t\tmethodName\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t{}\n\t)\n);\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,aAAa,eAAe,qBAAqB;AAK1D,OAAO,uBAAuB;AAkB9B,MAAM,qBAAqB,CAAE,YAAsB;AAClD,QAAM,EAAE,KAAK,MAAM,OAAO,aAAa,YAAY,SAAS,IAAI;AAChE,QAAM,OAAO,OAAO,OAAQ,WAAY,KAAK;AAC7C,QAAM,UAAU,OACb;AAAA,EAAqE,MAAM;AAAA,IAC3E;AAAA,EACA,CAAE,KACF,sCACA,WAAW;AAAA,EAAY,cAAe,QAAS,CAAE;AAAA,IAAO,GACxD;AAAA;AAAA,EAA+B,MAAM,IAAK,aAAc,CAAE;AAE7D,SAAO,MACN,GAAI,YAAa,MAAM,IAAI,YAAY,CAAE,CAAE;AAAA;AAAA,IAE3C,UACA;AAAA;AAAA,UACY,UAAW;AAAA;AAEzB;AAEA,MAAM,gBAAgB,CACrB,KACA,aACA,YACA,aACI;AACJ,QAAM,QAAQ,IAAI,KAAK;AAEvB,QAAM,OAAO,WACV,KAAK,UAAW,KAAM,EAAE,SAAU,KAAK,UAAW,QAAS,CAAE,IAC7D,MAAM,SAAS;AAElB,QAAM,UAAU,mBAAoB;AAAA,IACnC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEA,MAAM,gCACL,CAAE,aAAqB,eACvB,CAAE,aAAqD;AACtD,QAAM,MAAM,SAAU,UAAW;AACjC,QAAM,UAAU,cAAe,KAAK,aAAa,UAAW;AAC5D,MAAI,oBAAoB;AACxB,SAAO;AACR;AAED,MAAM,6BAA6B,CAClC,aACA,eAEA,SACC,aACG,UACa;AAChB,QAAM,MAAM,SAAU,UAAW;AACjC,QAAM,UAAU,cAAe,KAAK,aAAa,YAAY,QAAS;AACtE,MAAI,oBAAoB;AACxB,SAAO;AACR;AAOD,OAAO;AAAA,EACN,OAAO,QAAS,iBAAkB,EAAE;AAAA,IACnC,CAAE,QAAQ,CAAE,YAAY,WAAY,MAAO;AAC1C,YAAM,kBAAkB,GAAI,WAAY;AAExC,aAAO;AAAA,QACN,GAAG;AAAA,QACH,CAAE,WAAY,GAAG;AAAA,UAChB,IAAK,WAAY;AAAA,UACjB;AAAA,QACD;AAAA,QACA,CAAE,eAAgB,GAAG;AAAA,UACpB,IAAK,eAAgB;AAAA,UACrB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
const supportedMatchers = {
|
|
2
|
-
error:
|
|
3
|
-
info:
|
|
4
|
-
log:
|
|
5
|
-
warn:
|
|
2
|
+
error: "toHaveErrored",
|
|
3
|
+
info: "toHaveInformed",
|
|
4
|
+
log: "toHaveLogged",
|
|
5
|
+
warn: "toHaveWarned"
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var supported_matchers_default = supportedMatchers;
|
|
8
|
+
export {
|
|
9
|
+
supported_matchers_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=supported-matchers.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/supported-matchers.ts"],
|
|
4
|
+
"sourcesContent": ["const supportedMatchers: Record< string, string > = {\n\terror: 'toHaveErrored',\n\tinfo: 'toHaveInformed',\n\tlog: 'toHaveLogged',\n\twarn: 'toHaveWarned',\n};\n\nexport default supportedMatchers;\n"],
|
|
5
|
+
"mappings": "AAAA,MAAM,oBAA8C;AAAA,EACnD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AACP;AAEA,IAAO,6BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/jest-console",
|
|
3
|
-
"version": "8.32.0",
|
|
3
|
+
"version": "8.32.1-next.ff1cebbba.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",
|
|
@@ -31,9 +31,16 @@
|
|
|
31
31
|
],
|
|
32
32
|
"main": "build/index.js",
|
|
33
33
|
"module": "build-module/index.js",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./build-types/index.d.ts",
|
|
37
|
+
"import": "./build-module/index.js",
|
|
38
|
+
"require": "./build/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
34
42
|
"types": "build-types",
|
|
35
43
|
"dependencies": {
|
|
36
|
-
"@babel/runtime": "7.25.7",
|
|
37
44
|
"jest-matcher-utils": "^29.6.2"
|
|
38
45
|
},
|
|
39
46
|
"peerDependencies": {
|
|
@@ -42,5 +49,5 @@
|
|
|
42
49
|
"publishConfig": {
|
|
43
50
|
"access": "public"
|
|
44
51
|
},
|
|
45
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "c5b659710aff01d40d2eb97b211eb2cec9c07d3b"
|
|
46
53
|
}
|