@wordpress/jest-console 7.9.0 → 7.11.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/index.js CHANGED
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("./matchers");
6
-
7
5
  var _supportedMatchers = _interopRequireDefault(require("./supported-matchers"));
8
-
9
6
  /**
10
7
  * Internal dependencies
11
8
  */
@@ -19,25 +16,23 @@ var _supportedMatchers = _interopRequireDefault(require("./supported-matchers"))
19
16
  */
20
17
  const setConsoleMethodSpy = ([methodName, matcherName]) => {
21
18
  const spy = jest.spyOn(console, methodName).mockName(`console.${methodName}`);
19
+
22
20
  /**
23
21
  * Resets the spy to its initial state.
24
22
  */
25
-
26
23
  function resetSpy() {
27
24
  spy.mockReset();
28
25
  spy.assertionsNumber = 0;
29
26
  }
27
+
30
28
  /**
31
29
  * Verifies that the spy has only been called if expected.
32
30
  */
33
-
34
-
35
31
  function assertExpectedCalls() {
36
32
  if (spy.assertionsNumber === 0 && spy.mock.calls.length > 0) {
37
33
  expect(console).not[matcherName]();
38
34
  }
39
35
  }
40
-
41
36
  beforeAll(resetSpy);
42
37
  beforeEach(() => {
43
38
  assertExpectedCalls();
@@ -45,6 +40,5 @@ const setConsoleMethodSpy = ([methodName, matcherName]) => {
45
40
  });
46
41
  afterEach(assertExpectedCalls);
47
42
  };
48
-
49
43
  Object.entries(_supportedMatchers.default).forEach(setConsoleMethodSpy);
50
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/jest-console/src/index.js"],"names":["setConsoleMethodSpy","methodName","matcherName","spy","jest","spyOn","console","mockName","resetSpy","mockReset","assertionsNumber","assertExpectedCalls","mock","calls","length","expect","not","beforeAll","beforeEach","afterEach","Object","entries","supportedMatchers","forEach"],"mappings":";;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,mBAAmB,GAAG,CAAE,CAAEC,UAAF,EAAcC,WAAd,CAAF,KAAmC;AAC9D,QAAMC,GAAG,GAAGC,IAAI,CACdC,KADU,CACHC,OADG,EACML,UADN,EAEVM,QAFU,CAEC,WAAWN,UAAY,EAFxB,CAAZ;AAIA;AACD;AACA;;AACC,WAASO,QAAT,GAAoB;AACnBL,IAAAA,GAAG,CAACM,SAAJ;AACAN,IAAAA,GAAG,CAACO,gBAAJ,GAAuB,CAAvB;AACA;AAED;AACD;AACA;;;AACC,WAASC,mBAAT,GAA+B;AAC9B,QAAKR,GAAG,CAACO,gBAAJ,KAAyB,CAAzB,IAA8BP,GAAG,CAACS,IAAJ,CAASC,KAAT,CAAeC,MAAf,GAAwB,CAA3D,EAA+D;AAC9DC,MAAAA,MAAM,CAAET,OAAF,CAAN,CAAkBU,GAAlB,CAAuBd,WAAvB;AACA;AACD;;AAEDe,EAAAA,SAAS,CAAET,QAAF,CAAT;AAEAU,EAAAA,UAAU,CAAE,MAAM;AACjBP,IAAAA,mBAAmB;AACnBH,IAAAA,QAAQ;AACR,GAHS,CAAV;AAKAW,EAAAA,SAAS,CAAER,mBAAF,CAAT;AACA,CA9BD;;AAgCAS,MAAM,CAACC,OAAP,CAAgBC,0BAAhB,EAAoCC,OAApC,CAA6CvB,mBAA7C","sourcesContent":["/**\n * Internal dependencies\n */\nimport './matchers';\nimport supportedMatchers from './supported-matchers';\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 {Array} args\n * @param {string} args.\"0\" Name of console method.\n * @param {string} args.\"1\" Name of Jest matcher.\n */\nconst setConsoleMethodSpy = ( [ methodName, matcherName ] ) => {\n\tconst spy = jest\n\t\t.spyOn( console, methodName )\n\t\t.mockName( `console.${ methodName }` );\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"]}
1
+ {"version":3,"names":["require","_supportedMatchers","_interopRequireDefault","setConsoleMethodSpy","methodName","matcherName","spy","jest","spyOn","console","mockName","resetSpy","mockReset","assertionsNumber","assertExpectedCalls","mock","calls","length","expect","not","beforeAll","beforeEach","afterEach","Object","entries","supportedMatchers","forEach"],"sources":["@wordpress/jest-console/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './matchers';\nimport supportedMatchers from './supported-matchers';\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 {Array} args\n * @param {string} args.\"0\" Name of console method.\n * @param {string} args.\"1\" Name of Jest matcher.\n */\nconst setConsoleMethodSpy = ( [ methodName, matcherName ] ) => {\n\tconst spy = jest\n\t\t.spyOn( console, methodName )\n\t\t.mockName( `console.${ methodName }` );\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"],"mappings":";;;AAGAA,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,mBAAmB,GAAGA,CAAE,CAAEC,UAAU,EAAEC,WAAW,CAAE,KAAM;EAC9D,MAAMC,GAAG,GAAGC,IAAI,CACdC,KAAK,CAAEC,OAAO,EAAEL,UAAW,CAAC,CAC5BM,QAAQ,CAAG,WAAWN,UAAY,EAAE,CAAC;;EAEvC;AACD;AACA;EACC,SAASO,QAAQA,CAAA,EAAG;IACnBL,GAAG,CAACM,SAAS,CAAC,CAAC;IACfN,GAAG,CAACO,gBAAgB,GAAG,CAAC;EACzB;;EAEA;AACD;AACA;EACC,SAASC,mBAAmBA,CAAA,EAAG;IAC9B,IAAKR,GAAG,CAACO,gBAAgB,KAAK,CAAC,IAAIP,GAAG,CAACS,IAAI,CAACC,KAAK,CAACC,MAAM,GAAG,CAAC,EAAG;MAC9DC,MAAM,CAAET,OAAQ,CAAC,CAACU,GAAG,CAAEd,WAAW,CAAE,CAAC,CAAC;IACvC;EACD;EAEAe,SAAS,CAAET,QAAS,CAAC;EAErBU,UAAU,CAAE,MAAM;IACjBP,mBAAmB,CAAC,CAAC;IACrBH,QAAQ,CAAC,CAAC;EACX,CAAE,CAAC;EAEHW,SAAS,CAAER,mBAAoB,CAAC;AACjC,CAAC;AAEDS,MAAM,CAACC,OAAO,CAAEC,0BAAkB,CAAC,CAACC,OAAO,CAAEvB,mBAAoB,CAAC"}
package/build/matchers.js CHANGED
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _jestMatcherUtils = require("jest-matcher-utils");
6
-
7
5
  var _supportedMatchers = _interopRequireDefault(require("./supported-matchers"));
8
-
9
6
  /**
10
7
  * External dependencies
11
8
  */
@@ -13,6 +10,7 @@ var _supportedMatchers = _interopRequireDefault(require("./supported-matchers"))
13
10
  /**
14
11
  * Internal dependencies
15
12
  */
13
+
16
14
  const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
17
15
  const spy = received[methodName];
18
16
  const calls = spy.mock.calls;
@@ -24,7 +22,6 @@ const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
24
22
  pass
25
23
  };
26
24
  };
27
-
28
25
  const createToHaveBeenCalledWith = (matcherName, methodName) => function (received, ...expected) {
29
26
  const spy = received[methodName];
30
27
  const calls = spy.mock.calls;
@@ -36,10 +33,10 @@ const createToHaveBeenCalledWith = (matcherName, methodName) => function (receiv
36
33
  pass
37
34
  };
38
35
  };
39
-
40
36
  expect.extend(Object.entries(_supportedMatchers.default).reduce((result, [methodName, matcherName]) => {
41
37
  const matcherNameWith = `${matcherName}With`;
42
- return { ...result,
38
+ return {
39
+ ...result,
43
40
  [matcherName]: createToHaveBeenCalledMatcher(`.${matcherName}`, methodName),
44
41
  [matcherNameWith]: createToHaveBeenCalledWith(`.${matcherNameWith}`, methodName)
45
42
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/jest-console/src/matchers.js"],"names":["createToHaveBeenCalledMatcher","matcherName","methodName","received","spy","calls","mock","pass","length","message","getMockName","map","printReceived","assertionsNumber","createToHaveBeenCalledWith","expected","some","objects","equals","expect","extend","Object","entries","supportedMatchers","reduce","result","matcherNameWith"],"mappings":";;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,6BAA6B,GAClC,CAAEC,WAAF,EAAeC,UAAf,KAAiCC,QAAF,IAAgB;AAC9C,QAAMC,GAAG,GAAGD,QAAQ,CAAED,UAAF,CAApB;AACA,QAAMG,KAAK,GAAGD,GAAG,CAACE,IAAJ,CAASD,KAAvB;AACA,QAAME,IAAI,GAAGF,KAAK,CAACG,MAAN,GAAe,CAA5B;AACA,QAAMC,OAAO,GAAGF,IAAI,GACjB,MACA,mCAAc,OAAON,WAAa,EAAlC,EA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C1C,QAAMyB,eAAe,GAAI,GAAGzB,WAAa,MAAzC;AAEA,SAAO,EACN,GAAGwB,MADG;AAEN,KAAExB,WAAF,GAAiBD,6BAA6B,CAC5C,IAAIC,WAAa,EAD2B,EAE7CC,UAF6C,CAFxC;AAMN,KAAEwB,eAAF,GAAqBZ,0BAA0B,CAC7C,IAAIY,eAAiB,EADwB,EAE9CxB,UAF8C;AANzC,GAAP;AAWA,CAfF,EAgBC,EAhBD,CADD","sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher =\n\t( matcherName, methodName ) => ( received ) => {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.length > 0;\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called.';\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) =>\n\tfunction ( received, ...expected ) {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.some( ( objects ) =>\n\t\t\tthis.equals( objects, expected )\n\t\t);\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected ) +\n\t\t\t\t\t'\\n' +\n\t\t\t\t\t'but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived );\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nexpect.extend(\n\tObject.entries( supportedMatchers ).reduce(\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"]}
1
+ {"version":3,"names":["_jestMatcherUtils","require","_supportedMatchers","_interopRequireDefault","createToHaveBeenCalledMatcher","matcherName","methodName","received","spy","calls","mock","pass","length","message","matcherHint","getMockName","map","printReceived","assertionsNumber","createToHaveBeenCalledWith","expected","some","objects","equals","printExpected","expect","extend","Object","entries","supportedMatchers","reduce","result","matcherNameWith"],"sources":["@wordpress/jest-console/src/matchers.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher =\n\t( matcherName, methodName ) => ( received ) => {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.length > 0;\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called.';\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) =>\n\tfunction ( received, ...expected ) {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.some( ( objects ) =>\n\t\t\tthis.equals( objects, expected )\n\t\t);\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected ) +\n\t\t\t\t\t'\\n' +\n\t\t\t\t\t'but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived );\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nexpect.extend(\n\tObject.entries( supportedMatchers ).reduce(\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 ]: createToHaveBeenCal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AGF,IAAI,GACjB,MACA,IAAAG,6BAAW,EAAG,OAAOT,WAAa,EAAC,EAAEG,GAAG,CAACO,WAAW,CAAC,CAAE,CAAC,GACxD,MAAM,GACN,iDAAiD,GACjD,IAAAS,+BAAa,EAAEJ,QAAS,CAAC,GACzB,MACA,IAAAN,6BAAW,EAAET,WAAW,EAAEG,GAAG,CAACO,WAAW,CAAC,CAAE,CAAC,GAC7C,MAAM,GACN,6CAA6C,GAC7C,IAAAS,+BAAa,EAAEJ,QAAS,CAAC,GACzB,IAAI,GACJ,2BAA2B,GAC3BX,KAAK,CAACO,GAAG,CAAEC,+BAAc,CAAC;EAE7BT,GAAG,CAACU,gBAAgB,IAAI,CAAC;EAEzB,OAAO;IACNL,OAAO;IACPF;EACD,CAAC;AACF,CAAC;AAEFc,MAAM,CAACC,MAAM,CACZC,MAAM,CAACC,OAAO,CAAEC,0BAAkB,CAAC,CAACC,MAAM,CACzC,CAAEC,MAAM,EAAE,CAAEzB,UAAU,EAAED,WAAW,CAAE,KAAM;EAC1C,MAAM2B,eAAe,GAAI,GAAG3B,WAAa,MAAK;EAE9C,OAAO;IACN,GAAG0B,MAAM;IACT,CAAE1B,WAAW,GAAID,6BAA6B,CAC5C,IAAIC,WAAa,EAAC,EACnBC,UACD,CAAC;IACD,CAAE0B,eAAe,GAAIb,0BAA0B,CAC7C,IAAIa,eAAiB,EAAC,EACvB1B,UACD;EACD,CAAC;AACF,CAAC,EACD,CAAC,CACF,CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/jest-console/src/supported-matchers.js"],"names":["supportedMatchers","error","info","log","warn"],"mappings":";;;;;;AAAA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,KAAK,EAAE,eADkB;AAEzBC,EAAAA,IAAI,EAAE,gBAFmB;AAGzBC,EAAAA,GAAG,EAAE,cAHoB;AAIzBC,EAAAA,IAAI,EAAE;AAJmB,CAA1B;eAOeJ,iB","sourcesContent":["const supportedMatchers = {\n\terror: 'toHaveErrored',\n\tinfo: 'toHaveInformed',\n\tlog: 'toHaveLogged',\n\twarn: 'toHaveWarned',\n};\n\nexport default supportedMatchers;\n"]}
1
+ {"version":3,"names":["supportedMatchers","error","info","log","warn","_default","exports","default"],"sources":["@wordpress/jest-console/src/supported-matchers.js"],"sourcesContent":["const supportedMatchers = {\n\terror: 'toHaveErrored',\n\tinfo: 'toHaveInformed',\n\tlog: 'toHaveLogged',\n\twarn: 'toHaveWarned',\n};\n\nexport default supportedMatchers;\n"],"mappings":";;;;;;AAAA,MAAMA,iBAAiB,GAAG;EACzBC,KAAK,EAAE,eAAe;EACtBC,IAAI,EAAE,gBAAgB;EACtBC,GAAG,EAAE,cAAc;EACnBC,IAAI,EAAE;AACP,CAAC;AAAC,IAAAC,QAAA,GAEaL,iBAAiB;AAAAM,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import './matchers';
5
5
  import supportedMatchers from './supported-matchers';
6
+
6
7
  /**
7
8
  * Sets spy on the console object's method to make it possible to fail test when method called without assertion.
8
9
  *
@@ -10,28 +11,25 @@ import supportedMatchers from './supported-matchers';
10
11
  * @param {string} args."0" Name of console method.
11
12
  * @param {string} args."1" Name of Jest matcher.
12
13
  */
13
-
14
14
  const setConsoleMethodSpy = ([methodName, matcherName]) => {
15
15
  const spy = jest.spyOn(console, methodName).mockName(`console.${methodName}`);
16
+
16
17
  /**
17
18
  * Resets the spy to its initial state.
18
19
  */
19
-
20
20
  function resetSpy() {
21
21
  spy.mockReset();
22
22
  spy.assertionsNumber = 0;
23
23
  }
24
+
24
25
  /**
25
26
  * Verifies that the spy has only been called if expected.
26
27
  */
27
-
28
-
29
28
  function assertExpectedCalls() {
30
29
  if (spy.assertionsNumber === 0 && spy.mock.calls.length > 0) {
31
30
  expect(console).not[matcherName]();
32
31
  }
33
32
  }
34
-
35
33
  beforeAll(resetSpy);
36
34
  beforeEach(() => {
37
35
  assertExpectedCalls();
@@ -39,6 +37,5 @@ const setConsoleMethodSpy = ([methodName, matcherName]) => {
39
37
  });
40
38
  afterEach(assertExpectedCalls);
41
39
  };
42
-
43
40
  Object.entries(supportedMatchers).forEach(setConsoleMethodSpy);
44
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/jest-console/src/index.js"],"names":["supportedMatchers","setConsoleMethodSpy","methodName","matcherName","spy","jest","spyOn","console","mockName","resetSpy","mockReset","assertionsNumber","assertExpectedCalls","mock","calls","length","expect","not","beforeAll","beforeEach","afterEach","Object","entries","forEach"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,YAAP;AACA,OAAOA,iBAAP,MAA8B,sBAA9B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,CAAE,CAAEC,UAAF,EAAcC,WAAd,CAAF,KAAmC;AAC9D,QAAMC,GAAG,GAAGC,IAAI,CACdC,KADU,CACHC,OADG,EACML,UADN,EAEVM,QAFU,CAEC,WAAWN,UAAY,EAFxB,CAAZ;AAIA;AACD;AACA;;AACC,WAASO,QAAT,GAAoB;AACnBL,IAAAA,GAAG,CAACM,SAAJ;AACAN,IAAAA,GAAG,CAACO,gBAAJ,GAAuB,CAAvB;AACA;AAED;AACD;AACA;;;AACC,WAASC,mBAAT,GAA+B;AAC9B,QAAKR,GAAG,CAACO,gBAAJ,KAAyB,CAAzB,IAA8BP,GAAG,CAACS,IAAJ,CAASC,KAAT,CAAeC,MAAf,GAAwB,CAA3D,EAA+D;AAC9DC,MAAAA,MAAM,CAAET,OAAF,CAAN,CAAkBU,GAAlB,CAAuBd,WAAvB;AACA;AACD;;AAEDe,EAAAA,SAAS,CAAET,QAAF,CAAT;AAEAU,EAAAA,UAAU,CAAE,MAAM;AACjBP,IAAAA,mBAAmB;AACnBH,IAAAA,QAAQ;AACR,GAHS,CAAV;AAKAW,EAAAA,SAAS,CAAER,mBAAF,CAAT;AACA,CA9BD;;AAgCAS,MAAM,CAACC,OAAP,CAAgBtB,iBAAhB,EAAoCuB,OAApC,CAA6CtB,mBAA7C","sourcesContent":["/**\n * Internal dependencies\n */\nimport './matchers';\nimport supportedMatchers from './supported-matchers';\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 {Array} args\n * @param {string} args.\"0\" Name of console method.\n * @param {string} args.\"1\" Name of Jest matcher.\n */\nconst setConsoleMethodSpy = ( [ methodName, matcherName ] ) => {\n\tconst spy = jest\n\t\t.spyOn( console, methodName )\n\t\t.mockName( `console.${ methodName }` );\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"]}
1
+ {"version":3,"names":["supportedMatchers","setConsoleMethodSpy","methodName","matcherName","spy","jest","spyOn","console","mockName","resetSpy","mockReset","assertionsNumber","assertExpectedCalls","mock","calls","length","expect","not","beforeAll","beforeEach","afterEach","Object","entries","forEach"],"sources":["@wordpress/jest-console/src/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './matchers';\nimport supportedMatchers from './supported-matchers';\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 {Array} args\n * @param {string} args.\"0\" Name of console method.\n * @param {string} args.\"1\" Name of Jest matcher.\n */\nconst setConsoleMethodSpy = ( [ methodName, matcherName ] ) => {\n\tconst spy = jest\n\t\t.spyOn( console, methodName )\n\t\t.mockName( `console.${ methodName }` );\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,YAAY;AACnB,OAAOA,iBAAiB,MAAM,sBAAsB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAAE,CAAEC,UAAU,EAAEC,WAAW,CAAE,KAAM;EAC9D,MAAMC,GAAG,GAAGC,IAAI,CACdC,KAAK,CAAEC,OAAO,EAAEL,UAAW,CAAC,CAC5BM,QAAQ,CAAG,WAAWN,UAAY,EAAE,CAAC;;EAEvC;AACD;AACA;EACC,SAASO,QAAQA,CAAA,EAAG;IACnBL,GAAG,CAACM,SAAS,CAAC,CAAC;IACfN,GAAG,CAACO,gBAAgB,GAAG,CAAC;EACzB;;EAEA;AACD;AACA;EACC,SAASC,mBAAmBA,CAAA,EAAG;IAC9B,IAAKR,GAAG,CAACO,gBAAgB,KAAK,CAAC,IAAIP,GAAG,CAACS,IAAI,CAACC,KAAK,CAACC,MAAM,GAAG,CAAC,EAAG;MAC9DC,MAAM,CAAET,OAAQ,CAAC,CAACU,GAAG,CAAEd,WAAW,CAAE,CAAC,CAAC;IACvC;EACD;EAEAe,SAAS,CAAET,QAAS,CAAC;EAErBU,UAAU,CAAE,MAAM;IACjBP,mBAAmB,CAAC,CAAC;IACrBH,QAAQ,CAAC,CAAC;EACX,CAAE,CAAC;EAEHW,SAAS,CAAER,mBAAoB,CAAC;AACjC,CAAC;AAEDS,MAAM,CAACC,OAAO,CAAEtB,iBAAkB,CAAC,CAACuB,OAAO,CAAEtB,mBAAoB,CAAC"}
@@ -2,12 +2,11 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';
5
+
5
6
  /**
6
7
  * Internal dependencies
7
8
  */
8
-
9
9
  import supportedMatchers from './supported-matchers';
10
-
11
10
  const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
12
11
  const spy = received[methodName];
13
12
  const calls = spy.mock.calls;
@@ -19,7 +18,6 @@ const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
19
18
  pass
20
19
  };
21
20
  };
22
-
23
21
  const createToHaveBeenCalledWith = (matcherName, methodName) => function (received, ...expected) {
24
22
  const spy = received[methodName];
25
23
  const calls = spy.mock.calls;
@@ -31,10 +29,10 @@ const createToHaveBeenCalledWith = (matcherName, methodName) => function (receiv
31
29
  pass
32
30
  };
33
31
  };
34
-
35
32
  expect.extend(Object.entries(supportedMatchers).reduce((result, [methodName, matcherName]) => {
36
33
  const matcherNameWith = `${matcherName}With`;
37
- return { ...result,
34
+ return {
35
+ ...result,
38
36
  [matcherName]: createToHaveBeenCalledMatcher(`.${matcherName}`, methodName),
39
37
  [matcherNameWith]: createToHaveBeenCalledWith(`.${matcherNameWith}`, methodName)
40
38
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/jest-console/src/matchers.js"],"names":["matcherHint","printExpected","printReceived","supportedMatchers","createToHaveBeenCalledMatcher","matcherName","methodName","received","spy","calls","mock","pass","length","message","getMockName","map","assertionsNumber","createToHaveBeenCalledWith","expected","some","objects","equals","expect","extend","Object","entries","reduce","result","matcherNameWith"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,aAAtB,EAAqCC,aAArC,QAA0D,oBAA1D;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B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GAEA,6CAFA,GAGAb,aAAa,CAAEiB,QAAF,CAHb,GAIA,IAJA,GAKA,2BALA,GAMAT,KAAK,CAACM,GAAN,CAAWb,aAAX,CAbH;AAeAM,EAAAA,GAAG,CAACQ,gBAAJ,IAAwB,CAAxB;AAEA,SAAO;AACNH,IAAAA,OADM;AAENF,IAAAA;AAFM,GAAP;AAIA,CA5BF;;AA8BAW,MAAM,CAACC,MAAP,CACCC,MAAM,CAACC,OAAP,CAAgBtB,iBAAhB,EAAoCuB,MAApC,CACC,CAAEC,MAAF,EAAU,CAAErB,UAAF,EAAcD,WAAd,CAAV,KAA2C;AAC1C,QAAMuB,eAAe,GAAI,GAAGvB,WAAa,MAAzC;AAEA,SAAO,EACN,GAAGsB,MADG;AAEN,KAAEtB,WAAF,GAAiBD,6BAA6B,CAC5C,IAAIC,WAAa,EAD2B,EAE7CC,UAF6C,CAFxC;AAMN,KAAEsB,eAAF,GAAqBX,0BAA0B,CAC7C,IAAIW,eAAiB,EADwB,EAE9CtB,UAF8C;AANzC,GAAP;AAWA,CAfF,EAgBC,EAhBD,CADD","sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher =\n\t( matcherName, methodName ) => ( received ) => {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.length > 0;\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called.';\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) =>\n\tfunction ( received, ...expected ) {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.some( ( objects ) =>\n\t\t\tthis.equals( objects, expected )\n\t\t);\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected ) +\n\t\t\t\t\t'\\n' +\n\t\t\t\t\t'but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived );\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nexpect.extend(\n\tObject.entries( supportedMatchers ).reduce(\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"]}
1
+ {"version":3,"names":["matcherHint","printExpected","printReceived","supportedMatchers","createToHaveBeenCalledMatcher","matcherName","methodName","received","spy","calls","mock","pass","length","message","getMockName","map","assertionsNumber","createToHaveBeenCalledWith","expected","some","objects","equals","expect","extend","Object","entries","reduce","result","matcherNameWith"],"sources":["@wordpress/jest-console/src/matchers.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher =\n\t( matcherName, methodName ) => ( received ) => {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.length > 0;\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called.';\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) =>\n\tfunction ( received, ...expected ) {\n\t\tconst spy = received[ methodName ];\n\t\tconst calls = spy.mock.calls;\n\t\tconst pass = calls.some( ( objects ) =>\n\t\t\tthis.equals( objects, expected )\n\t\t);\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected )\n\t\t\t: () =>\n\t\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\t\tprintExpected( expected ) +\n\t\t\t\t\t'\\n' +\n\t\t\t\t\t'but it was called with:\\n' +\n\t\t\t\t\tcalls.map( printReceived );\n\n\t\tspy.assertionsNumber += 1;\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t};\n\t};\n\nexpect.extend(\n\tObject.entries( supportedMatchers ).reduce(\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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,aAAa,EAAEC,aAAa,QAAQ,oBAAoB;;AAE9E;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,sBAAsB;AAEpD,MAAMC,6BAA6B,GAClCA,CAAEC,WAAW,EAAEC,UAAU,KAAQC,QAAQ,IAAM;EAC9C,MAAMC,GAAG,GAAGD,QAAQ,CAAED,UAAU,CAAE;EAClC,MAAMG,KAAK,GAAGD,GAAG,CAACE,IAAI,CAACD,KAAK;EAC5B,MAAME,IAAI,GAAGF,KAAK,CAACG,MAAM,GAAG,CAAC;EAC7B,MAAMC,OAAO,GAAGF,IAAI,GACjB,MACAX,WAAW,CAAG,OAAOK,WAAa,EAAC,EAAEG,GAAG,CAACM,WAAW,CAAC,CAAE,CAAC,GACxD,MAAM,GACN,mEAAmE,GACnEL,KAAK,CAACM,GAAG,CAAEb,aAAc,CAAC,GAC1B,MACAF,WAAW,CAAEK,WAAW,EAAEG,GAAG,CAACM,WAAW,CAAC,CAAE,CAAC,GAC7C,MAAM,GACN,sCAAsC;EAEzCN,GAAG,CAACQ,gBAAgB,IAAI,CAAC;EAEzB,OAAO;IACNH,OAAO;IACPF;EACD,CAAC;AACF,CAAC;AAEF,M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AAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/jest-console/src/supported-matchers.js"],"names":["supportedMatchers","error","info","log","warn"],"mappings":"AAAA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,KAAK,EAAE,eADkB;AAEzBC,EAAAA,IAAI,EAAE,gBAFmB;AAGzBC,EAAAA,GAAG,EAAE,cAHoB;AAIzBC,EAAAA,IAAI,EAAE;AAJmB,CAA1B;AAOA,eAAeJ,iBAAf","sourcesContent":["const supportedMatchers = {\n\terror: 'toHaveErrored',\n\tinfo: 'toHaveInformed',\n\tlog: 'toHaveLogged',\n\twarn: 'toHaveWarned',\n};\n\nexport default supportedMatchers;\n"]}
1
+ {"version":3,"names":["supportedMatchers","error","info","log","warn"],"sources":["@wordpress/jest-console/src/supported-matchers.js"],"sourcesContent":["const supportedMatchers = {\n\terror: 'toHaveErrored',\n\tinfo: 'toHaveInformed',\n\tlog: 'toHaveLogged',\n\twarn: 'toHaveWarned',\n};\n\nexport default supportedMatchers;\n"],"mappings":"AAAA,MAAMA,iBAAiB,GAAG;EACzBC,KAAK,EAAE,eAAe;EACtBC,IAAI,EAAE,gBAAgB;EACtBC,GAAG,EAAE,cAAc;EACnBC,IAAI,EAAE;AACP,CAAC;AAED,eAAeJ,iBAAiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/jest-console",
3
- "version": "7.9.0",
3
+ "version": "7.11.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",
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "6f14d11ed4cb59df110a28ebaa23ecba95eb673a"
44
+ "gitHead": "78a288d55b83a713b2f7d98d5a855c0771a2afc6"
45
45
  }