@wordpress/jest-console 4.1.1-next.5df0cd52b7.0 → 5.0.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.0.0 (2022-01-27)
6
+
7
+ ### Breaking Changes
8
+
9
+ - The peer `jest` dependency has been updated from requiring `>=26` to requiring `>=27` (see [Breaking Changes](https://jestjs.io/blog/2021/05/25/jest-27), [#33287](https://github.com/WordPress/gutenberg/pull/33287)).
10
+
5
11
  ## 4.0.0 (2021-01-21)
6
12
 
7
13
  ### Breaking Changes
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2021 by the contributors
3
+ Copyright 2016-2022 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
package/README.md CHANGED
@@ -115,4 +115,10 @@ specific arguments.
115
115
 
116
116
  Almost identical usage as `.toHaveErroredWith()`.
117
117
 
118
- <br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
118
+ ## Contributing to this package
119
+
120
+ This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
121
+
122
+ To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
123
+
124
+ <br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
package/build/matchers.js CHANGED
@@ -27,7 +27,11 @@ const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
27
27
  };
28
28
  };
29
29
 
30
- const createToHaveBeenCalledWith = (matcherName, methodName) => (received, ...expected) => {
30
+ const createToHaveBeenCalledWith = (matcherName, methodName) => function (received) {
31
+ for (var _len = arguments.length, expected = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
+ expected[_key - 1] = arguments[_key];
33
+ }
34
+
31
35
  const spy = received[methodName];
32
36
  const calls = spy.mock.calls;
33
37
  const pass = (0, _lodash.some)(calls, objects => (0, _lodash.isEqual)(objects, expected));
@@ -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","objects","expect","extend","supportedMatchers","result","matcherNameWith"],"mappings":";;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,6BAA6B,GAAG,CAAEC,WAAF,EAAeC,UAAf,KACrCC,QADoE,IAEhE;AACJ,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,EAAqCG,GAAG,CAACM,WAAJ,EAArC,IACA,MADA,GAEA,mEAFA,GAGAL,KAAK,CAACM,GAAN,CAAWC,+BAAX,CALiB,GAMjB,MACA,mCAAaX,WAAb,EAA0BG,GAAG,CAACM,WAAJ,EAA1B,IACA,MADA,GAEA,sCATH;AAWAN,EAAAA,GAAG,CAACS,gBAAJ,IAAwB,CAAxB;AAEA,SAAO;AACNJ,IAAAA,OADM;AAENF,IAAAA;AAFM,GAAP;AAIA,CAvBD;;AAyBA,MAAMO,0BAA0B,GAAG,CAAEb,WAAF,EAAeC,UAAf,KAA+B,CACjEC,QADiE,EAEjE,GAAGY,QAF8D,KAG7D;AACJ,QAAMX,GAAG,GAAGD,QAAQ,CAAED,UAAF,CAApB;AACA,QAAMG,KAAK,GAAGD,GAAG,CAACE,IAAJ,CAASD,KAAvB;AACA,QAAME,IAAI,GAAG,kBAAMF,KAAN,EAAeW,OAAF,IAAe,qBAASA,OAAT,EAAkBD,QAAlB,CAA5B,CAAb;AACA,QAAMN,OAAO,GAAGF,IAAI,GACjB,MACA,mCAAc,OAAON,WAAa,EAAlC,EAAqCG,GAAG,CAACM,WAAJ,EAArC,IACA,MADA,GAEA,iDAFA,GAGA,qCAAeK,QAAf,CALiB,GAMjB,MACA,mCAAad,WAAb,EAA0BG,GAAG,CAACM,WAAJ,EAA1B,IACA,MADA,GAEA,6CAFA,GAGA,qCAAeK,QAAf,CAHA,GAIA,IAJA,GAKA,2BALA,GAMAV,KAAK,CAACM,GAAN,CAAWC,+BAAX,CAbH;AAeAR,EAAAA,GAAG,CAACS,gBAAJ,IAAwB,CAAxB;AAEA,SAAO;AACNJ,IAAAA,OADM;AAENF,IAAAA;AAFM,GAAP;AAIA,CA5BD;;AA8BAU,MAAM,CAACC,MAAP,CACC,oBACCC,0BADD,EAEC,CAAEC,MAAF,EAAUnB,WAAV,EAAuBC,UAAvB,KAAuC;AACtC,QAAMmB,eAAe,GAAI,GAAGpB,WAAa,MAAzC;AAEA,SAAO,EACN,GAAGmB,MADG;AAEN,KAAEnB,WAAF,GAAiBD,6BAA6B,CAC5C,IAAIC,WAAa,EAD2B,EAE7CC,UAF6C,CAFxC;AAMN,KAAEmB,eAAF,GAAqBP,0BAA0B,CAC7C,IAAIO,eAAiB,EADwB,EAE9CnB,UAF8C;AANzC,GAAP;AAWA,CAhBF,EAiBC,EAjBD,CADD","sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\nimport { isEqual, reduce, some } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher = ( matcherName, methodName ) => (\n\treceived\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = calls.length > 0;\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called.';\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) => (\n\treceived,\n\t...expected\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = some( calls, ( objects ) => isEqual( objects, expected ) );\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\tprintExpected( expected )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\tprintExpected( expected ) +\n\t\t\t\t'\\n' +\n\t\t\t\t'but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived );\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nexpect.extend(\n\treduce(\n\t\tsupportedMatchers,\n\t\t( result, matcherName, methodName ) => {\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,"sources":["@wordpress/jest-console/src/matchers.js"],"names":["createToHaveBeenCalledMatcher","matcherName","methodName","received","spy","calls","mock","pass","length","message","getMockName","map","printReceived","assertionsNumber","createToHaveBeenCalledWith","expected","objects","expect","extend","supportedMatchers","result","matcherNameWith"],"mappings":";;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,6BAA6B,GAAG,CAAEC,WAAF,EAAeC,UAAf,KACrCC,QADoE,IAEhE;AACJ,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,EAAqCG,GAAG,CAACM,WAAJ,EAArC,IACA,MADA,GAEA,mEAFA,GAGAL,KAAK,CAACM,GAAN,CAAWC,+BAAX,CALiB,GAMjB,MACA,mCAAaX,WAAb,EAA0BG,GAAG,CAACM,WAAJ,EAA1B,IACA,MADA,GAEA,sCATH;AAWAN,EAAAA,GAAG,CAACS,gBAAJ,IAAwB,CAAxB;AAEA,SAAO;AACNJ,IAAAA,OADM;AAENF,IAAAA;AAFM,GAAP;AAIA,CAvBD;;AAyBA,MAAMO,0BAA0B,GAAG,CAAEb,WAAF,EAAeC,UAAf,KAA+B,UACjEC,QADiE,EAG7D;AAAA,oCADDY,QACC;AADDA,IAAAA,QACC;AAAA;;AACJ,QAAMX,GAAG,GAAGD,QAAQ,CAAED,UAAF,CAApB;AACA,QAAMG,KAAK,GAAGD,GAAG,CAACE,IAAJ,CAASD,KAAvB;AACA,QAAME,IAAI,GAAG,kBAAMF,KAAN,EAAeW,OAAF,IAAe,qBAASA,OAAT,EAAkBD,QAAlB,CAA5B,CAAb;AACA,QAAMN,OAAO,GAAGF,IAAI,GACjB,MACA,mCAAc,OAAON,WAAa,EAAlC,EAAqCG,GAAG,CAACM,WAAJ,EAArC,IACA,MADA,GAEA,iDAFA,GAGA,qCAAeK,QAAf,CALiB,GAMjB,MACA,mCAAad,WAAb,EAA0BG,GAAG,CAACM,WAAJ,EAA1B,IACA,MADA,GAEA,6CAFA,GAGA,qCAAeK,QAAf,CAHA,GAIA,IAJA,GAKA,2BALA,GAMAV,KAAK,CAACM,GAAN,CAAWC,+BAAX,CAbH;AAeAR,EAAAA,GAAG,CAACS,gBAAJ,IAAwB,CAAxB;AAEA,SAAO;AACNJ,IAAAA,OADM;AAENF,IAAAA;AAFM,GAAP;AAIA,CA5BD;;AA8BAU,MAAM,CAACC,MAAP,CACC,oBACCC,0BADD,EAEC,CAAEC,MAAF,EAAUnB,WAAV,EAAuBC,UAAvB,KAAuC;AACtC,QAAMmB,eAAe,GAAI,GAAGpB,WAAa,MAAzC;AAEA,SAAO,EACN,GAAGmB,MADG;AAEN,KAAEnB,WAAF,GAAiBD,6BAA6B,CAC5C,IAAIC,WAAa,EAD2B,EAE7CC,UAF6C,CAFxC;AAMN,KAAEmB,eAAF,GAAqBP,0BAA0B,CAC7C,IAAIO,eAAiB,EADwB,EAE9CnB,UAF8C;AANzC,GAAP;AAWA,CAhBF,EAiBC,EAjBD,CADD","sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\nimport { isEqual, reduce, some } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher = ( matcherName, methodName ) => (\n\treceived\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = calls.length > 0;\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called.';\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) => (\n\treceived,\n\t...expected\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = some( calls, ( objects ) => isEqual( objects, expected ) );\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\tprintExpected( expected )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\tprintExpected( expected ) +\n\t\t\t\t'\\n' +\n\t\t\t\t'but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived );\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nexpect.extend(\n\treduce(\n\t\tsupportedMatchers,\n\t\t( result, matcherName, methodName ) => {\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"]}
@@ -21,7 +21,11 @@ const createToHaveBeenCalledMatcher = (matcherName, methodName) => received => {
21
21
  };
22
22
  };
23
23
 
24
- const createToHaveBeenCalledWith = (matcherName, methodName) => (received, ...expected) => {
24
+ const createToHaveBeenCalledWith = (matcherName, methodName) => function (received) {
25
+ for (var _len = arguments.length, expected = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
26
+ expected[_key - 1] = arguments[_key];
27
+ }
28
+
25
29
  const spy = received[methodName];
26
30
  const calls = spy.mock.calls;
27
31
  const pass = some(calls, objects => isEqual(objects, expected));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/jest-console/src/matchers.js"],"names":["matcherHint","printExpected","printReceived","isEqual","reduce","some","supportedMatchers","createToHaveBeenCalledMatcher","matcherName","methodName","received","spy","calls","mock","pass","length","message","getMockName","map","assertionsNumber","createToHaveBeenCalledWith","expected","objects","expect","extend","result","matcherNameWith"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,aAAtB,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,OAAT,EAAkBC,MAAlB,EAA0BC,IAA1B,QAAsC,QAAtC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,sBAA9B;;AAEA,MAAMC,6BAA6B,GAAG,CAAEC,WAAF,EAAeC,UAAf,KACrCC,QADoE,IAEhE;AACJ,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,MACAd,WAAW,CAAG,OAAOQ,WAAa,EAAvB,EAA0BG,GAAG,CAACM,WAAJ,EAA1B,CAAX,GACA,MADA,GAEA,mEAFA,GAGAL,KAAK,CAACM,GAAN,CAAWhB,aAAX,CALiB,GAMjB,MACAF,WAAW,CAAEQ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B,CAC5C,IAAIC,WAAa,EAD2B,EAE7CC,UAF6C,CAFxC;AAMN,KAAEiB,eAAF,GAAqBN,0BAA0B,CAC7C,IAAIM,eAAiB,EADwB,EAE9CjB,UAF8C;AANzC,GAAP;AAWA,CAhBI,EAiBL,EAjBK,CADP","sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\nimport { isEqual, reduce, some } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher = ( matcherName, methodName ) => (\n\treceived\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = calls.length > 0;\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called.';\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) => (\n\treceived,\n\t...expected\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = some( calls, ( objects ) => isEqual( objects, expected ) );\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\tprintExpected( expected )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\tprintExpected( expected ) +\n\t\t\t\t'\\n' +\n\t\t\t\t'but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived );\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nexpect.extend(\n\treduce(\n\t\tsupportedMatchers,\n\t\t( result, matcherName, methodName ) => {\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,"sources":["@wordpress/jest-console/src/matchers.js"],"names":["matcherHint","printExpected","printReceived","isEqual","reduce","some","supportedMatchers","createToHaveBeenCalledMatcher","matcherName","methodName","received","spy","calls","mock","pass","length","message","getMockName","map","assertionsNumber","createToHaveBeenCalledWith","expected","objects","expect","extend","result","matcherNameWith"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,aAAtB,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,OAAT,EAAkBC,MAAlB,EAA0BC,IAA1B,QAAsC,QAAtC;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,sBAA9B;;AAEA,MAAMC,6BAA6B,GAAG,CAAEC,WAAF,EAAeC,UAAf,KACrCC,QADoE,IAEhE;AACJ,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,MACAd,WAAW,CAAG,OAAOQ,WAAa,EAAvB,EAA0BG,GAAG,CAACM,W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AAuBC,UAAvB,KAAuC;AACtC,QAAMiB,eAAe,GAAI,GAAGlB,WAAa,MAAzC;AAEA,SAAO,EACN,GAAGiB,MADG;AAEN,KAAEjB,WAAF,GAAiBD,6BAA6B,CAC5C,IAAIC,WAAa,EAD2B,EAE7CC,UAF6C,CAFxC;AAMN,KAAEiB,eAAF,GAAqBN,0BAA0B,CAC7C,IAAIM,eAAiB,EADwB,EAE9CjB,UAF8C;AANzC,GAAP;AAWA,CAhBI,EAiBL,EAjBK,CADP","sourcesContent":["/**\n * External dependencies\n */\nimport { matcherHint, printExpected, printReceived } from 'jest-matcher-utils';\nimport { isEqual, reduce, some } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport supportedMatchers from './supported-matchers';\n\nconst createToHaveBeenCalledMatcher = ( matcherName, methodName ) => (\n\treceived\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = calls.length > 0;\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called.';\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nconst createToHaveBeenCalledWith = ( matcherName, methodName ) => (\n\treceived,\n\t...expected\n) => {\n\tconst spy = received[ methodName ];\n\tconst calls = spy.mock.calls;\n\tconst pass = some( calls, ( objects ) => isEqual( objects, expected ) );\n\tconst message = pass\n\t\t? () =>\n\t\t\t\tmatcherHint( `.not${ matcherName }`, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function not to be called with:\\n' +\n\t\t\t\tprintExpected( expected )\n\t\t: () =>\n\t\t\t\tmatcherHint( matcherName, spy.getMockName() ) +\n\t\t\t\t'\\n\\n' +\n\t\t\t\t'Expected mock function to be called with:\\n' +\n\t\t\t\tprintExpected( expected ) +\n\t\t\t\t'\\n' +\n\t\t\t\t'but it was called with:\\n' +\n\t\t\t\tcalls.map( printReceived );\n\n\tspy.assertionsNumber += 1;\n\n\treturn {\n\t\tmessage,\n\t\tpass,\n\t};\n};\n\nexpect.extend(\n\treduce(\n\t\tsupportedMatchers,\n\t\t( result, matcherName, methodName ) => {\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/jest-console",
3
- "version": "4.1.1-next.5df0cd52b7.0",
3
+ "version": "5.0.1",
4
4
  "description": "Custom Jest matchers for the Console object.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,15 +30,15 @@
30
30
  "main": "build/index.js",
31
31
  "module": "build-module/index.js",
32
32
  "dependencies": {
33
- "@babel/runtime": "^7.13.10",
34
- "jest-matcher-utils": "^26.6.2",
33
+ "@babel/runtime": "^7.16.0",
34
+ "jest-matcher-utils": "^27.4.2",
35
35
  "lodash": "^4.17.21"
36
36
  },
37
37
  "peerDependencies": {
38
- "jest": ">=26"
38
+ "jest": ">=27"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "558d577d12bec15f05e694eb49a094836d885cca"
43
+ "gitHead": "2e4922861e49f5a090f9dc52056165092cfba163"
44
44
  }