@thisisagile/easy-test 15.8.6 → 15.8.7

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 (147) hide show
  1. package/dist/index.d.ts +2 -379
  2. package/dist/index.js +25 -3
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.mjs +3 -3
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/matchers/Check.d.ts +17 -0
  7. package/dist/matchers/Check.js +64 -0
  8. package/dist/matchers/Check.js.map +1 -0
  9. package/dist/matchers/Check.mjs +39 -0
  10. package/dist/matchers/Check.mjs.map +1 -0
  11. package/dist/matchers/HttpMatchers.d.ts +31 -0
  12. package/dist/matchers/HttpMatchers.js +89 -0
  13. package/dist/matchers/HttpMatchers.js.map +1 -0
  14. package/dist/matchers/HttpMatchers.mjs +54 -0
  15. package/dist/matchers/HttpMatchers.mjs.map +1 -0
  16. package/dist/matchers/Match.d.ts +12 -0
  17. package/dist/matchers/Match.js +59 -0
  18. package/dist/matchers/Match.js.map +1 -0
  19. package/dist/matchers/Match.mjs +34 -0
  20. package/dist/matchers/Match.mjs.map +1 -0
  21. package/dist/matchers/ResultMatchers.d.ts +13 -0
  22. package/dist/matchers/ResultMatchers.js +51 -0
  23. package/dist/matchers/ResultMatchers.js.map +1 -0
  24. package/dist/matchers/ResultMatchers.mjs +25 -0
  25. package/dist/matchers/ResultMatchers.mjs.map +1 -0
  26. package/dist/matchers/index.d.ts +19 -0
  27. package/dist/matchers/index.js +59 -0
  28. package/dist/matchers/index.js.map +1 -0
  29. package/dist/matchers/index.mjs +20 -0
  30. package/dist/matchers/index.mjs.map +1 -0
  31. package/dist/matchers/toBeArrayOf.d.ts +9 -0
  32. package/dist/matchers/toBeArrayOf.js +33 -0
  33. package/dist/matchers/toBeArrayOf.js.map +1 -0
  34. package/dist/matchers/toBeArrayOf.mjs +9 -0
  35. package/dist/matchers/toBeArrayOf.mjs.map +1 -0
  36. package/dist/matchers/toBeArrayOfWithLength.d.ts +9 -0
  37. package/dist/matchers/toBeArrayOfWithLength.js +36 -0
  38. package/dist/matchers/toBeArrayOfWithLength.js.map +1 -0
  39. package/dist/matchers/toBeArrayOfWithLength.mjs +12 -0
  40. package/dist/matchers/toBeArrayOfWithLength.mjs.map +1 -0
  41. package/dist/matchers/toBeAt.d.ts +9 -0
  42. package/dist/matchers/toBeAt.js +44 -0
  43. package/dist/matchers/toBeAt.js.map +1 -0
  44. package/dist/matchers/toBeAt.mjs +20 -0
  45. package/dist/matchers/toBeAt.mjs.map +1 -0
  46. package/dist/matchers/toBeExactlyAt.d.ts +9 -0
  47. package/dist/matchers/toBeExactlyAt.js +43 -0
  48. package/dist/matchers/toBeExactlyAt.js.map +1 -0
  49. package/dist/matchers/toBeExactlyAt.mjs +19 -0
  50. package/dist/matchers/toBeExactlyAt.mjs.map +1 -0
  51. package/dist/matchers/toBeQueriedWith.d.ts +9 -0
  52. package/dist/matchers/toBeQueriedWith.js +36 -0
  53. package/dist/matchers/toBeQueriedWith.js.map +1 -0
  54. package/dist/matchers/toBeQueriedWith.mjs +12 -0
  55. package/dist/matchers/toBeQueriedWith.mjs.map +1 -0
  56. package/dist/matchers/toBeRoutedTo.d.ts +9 -0
  57. package/dist/matchers/toBeRoutedTo.js +37 -0
  58. package/dist/matchers/toBeRoutedTo.js.map +1 -0
  59. package/dist/matchers/toBeRoutedTo.mjs +13 -0
  60. package/dist/matchers/toBeRoutedTo.mjs.map +1 -0
  61. package/dist/matchers/toBeValid.d.ts +8 -0
  62. package/dist/matchers/toBeValid.js +34 -0
  63. package/dist/matchers/toBeValid.js.map +1 -0
  64. package/dist/matchers/toBeValid.mjs +10 -0
  65. package/dist/matchers/toBeValid.mjs.map +1 -0
  66. package/dist/matchers/toFailMatcher.d.ts +19 -0
  67. package/dist/matchers/toFailMatcher.js +59 -0
  68. package/dist/matchers/toFailMatcher.js.map +1 -0
  69. package/dist/matchers/toFailMatcher.mjs +32 -0
  70. package/dist/matchers/toFailMatcher.mjs.map +1 -0
  71. package/dist/matchers/toMatchArray.d.ts +9 -0
  72. package/dist/matchers/toMatchArray.js +35 -0
  73. package/dist/matchers/toMatchArray.js.map +1 -0
  74. package/dist/matchers/toMatchArray.mjs +11 -0
  75. package/dist/matchers/toMatchArray.mjs.map +1 -0
  76. package/dist/matchers/toMatchExactJson.d.ts +14 -0
  77. package/dist/matchers/toMatchExactJson.js +42 -0
  78. package/dist/matchers/toMatchExactJson.js.map +1 -0
  79. package/dist/matchers/toMatchExactJson.mjs +17 -0
  80. package/dist/matchers/toMatchExactJson.mjs.map +1 -0
  81. package/dist/matchers/toMatchException.d.ts +9 -0
  82. package/dist/matchers/toMatchException.js +43 -0
  83. package/dist/matchers/toMatchException.js.map +1 -0
  84. package/dist/matchers/toMatchException.mjs +19 -0
  85. package/dist/matchers/toMatchException.mjs.map +1 -0
  86. package/dist/matchers/toMatchJson.d.ts +14 -0
  87. package/dist/matchers/toMatchJson.js +43 -0
  88. package/dist/matchers/toMatchJson.js.map +1 -0
  89. package/dist/matchers/toMatchJson.mjs +18 -0
  90. package/dist/matchers/toMatchJson.mjs.map +1 -0
  91. package/dist/matchers/toMatchRoute.d.ts +9 -0
  92. package/dist/matchers/toMatchRoute.js +37 -0
  93. package/dist/matchers/toMatchRoute.js.map +1 -0
  94. package/dist/matchers/toMatchRoute.mjs +13 -0
  95. package/dist/matchers/toMatchRoute.mjs.map +1 -0
  96. package/dist/matchers/toMatchText.d.ts +8 -0
  97. package/dist/matchers/toMatchText.js +37 -0
  98. package/dist/matchers/toMatchText.js.map +1 -0
  99. package/dist/matchers/toMatchText.mjs +13 -0
  100. package/dist/matchers/toMatchText.mjs.map +1 -0
  101. package/dist/matchers/toPassMatcher.d.ts +19 -0
  102. package/dist/matchers/toPassMatcher.js +59 -0
  103. package/dist/matchers/toPassMatcher.js.map +1 -0
  104. package/dist/matchers/toPassMatcher.mjs +32 -0
  105. package/dist/matchers/toPassMatcher.mjs.map +1 -0
  106. package/dist/mock/Fits.d.ts +24 -0
  107. package/dist/mock/Fits.js +71 -0
  108. package/dist/mock/Fits.js.map +1 -0
  109. package/dist/mock/Fits.mjs +44 -0
  110. package/dist/mock/Fits.mjs.map +1 -0
  111. package/dist/mock/Mocks.d.ts +39 -0
  112. package/dist/mock/Mocks.js +98 -0
  113. package/dist/mock/Mocks.js.map +1 -0
  114. package/dist/mock/Mocks.mjs +73 -0
  115. package/dist/mock/Mocks.mjs.map +1 -0
  116. package/dist/mock/index.d.ts +2 -0
  117. package/dist/mock/index.js +25 -0
  118. package/dist/mock/index.js.map +1 -0
  119. package/dist/mock/index.mjs +3 -0
  120. package/dist/mock/index.mjs.map +1 -0
  121. package/dist/utils/Eq.d.ts +5 -0
  122. package/dist/utils/Eq.js +35 -0
  123. package/dist/utils/Eq.js.map +1 -0
  124. package/dist/utils/Eq.mjs +11 -0
  125. package/dist/utils/Eq.mjs.map +1 -0
  126. package/dist/utils/Req.d.ts +14 -0
  127. package/dist/utils/Req.js +59 -0
  128. package/dist/utils/Req.js.map +1 -0
  129. package/dist/utils/Req.mjs +35 -0
  130. package/dist/utils/Req.mjs.map +1 -0
  131. package/dist/utils/Response.d.ts +25 -0
  132. package/dist/utils/Response.js +17 -0
  133. package/dist/utils/Response.js.map +1 -0
  134. package/dist/utils/Response.mjs +1 -0
  135. package/dist/utils/Response.mjs.map +1 -0
  136. package/dist/utils/Types.d.ts +44 -0
  137. package/dist/utils/Types.js +30 -0
  138. package/dist/utils/Types.js.map +1 -0
  139. package/dist/utils/Types.mjs +6 -0
  140. package/dist/utils/Types.mjs.map +1 -0
  141. package/dist/utils/Utils.d.ts +12 -0
  142. package/dist/utils/Utils.js +62 -0
  143. package/dist/utils/Utils.js.map +1 -0
  144. package/dist/utils/Utils.mjs +28 -0
  145. package/dist/utils/Utils.mjs.map +1 -0
  146. package/package.json +2 -2
  147. package/dist/index.d.mts +0 -379
@@ -0,0 +1,12 @@
1
+ import { match } from "./Match";
2
+ const toBeArrayOfWithLength = (items, ctor, length) => match(items).undefined((it) => it, "Subject is undefined.").not((it) => it instanceof Array, "Subject is not an array.").not(
3
+ (it) => it.length === length,
4
+ (it) => `Subject does not have ${length} elements, but ${it.length}.`
5
+ ).not((it) => it.every((i) => i instanceof ctor), `Not all elements are of type '${ctor.name}'.`).else(`Subject has ${length} elements, which are all of type '${ctor.name}'`);
6
+ expect.extend({
7
+ toBeArrayOfWithLength
8
+ });
9
+ export {
10
+ toBeArrayOfWithLength
11
+ };
12
+ //# sourceMappingURL=toBeArrayOfWithLength.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeArrayOfWithLength.ts"],"sourcesContent":["import { Constructor as Ctor } from '../utils/Types';\nimport { match } from './Match';\n\nexport const toBeArrayOfWithLength = <T>(items: unknown, ctor: Ctor<T>, length: number): jest.CustomMatcherResult =>\n match<unknown>(items)\n .undefined(it => it, 'Subject is undefined.')\n .not(it => it instanceof Array, 'Subject is not an array.')\n .not(\n it => (it as []).length === length,\n it => `Subject does not have ${length} elements, but ${(it as []).length}.`\n )\n .not(it => (it as []).every((i: any) => i instanceof ctor), `Not all elements are of type '${ctor.name}'.`)\n .else(`Subject has ${length} elements, which are all of type '${ctor.name}'`);\n\nexpect.extend({\n toBeArrayOfWithLength,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeArrayOfWithLength<Z>(ctor: Ctor<Z>, length: number): R;\n }\n }\n}\n"],"mappings":"AACA,SAAS,aAAa;AAEf,MAAM,wBAAwB,CAAI,OAAgB,MAAe,WACtE,MAAe,KAAK,EACjB,UAAU,QAAM,IAAI,uBAAuB,EAC3C,IAAI,QAAM,cAAc,OAAO,0BAA0B,EACzD;AAAA,EACC,QAAO,GAAU,WAAW;AAAA,EAC5B,QAAM,yBAAyB,MAAM,kBAAmB,GAAU,MAAM;AAC1E,EACC,IAAI,QAAO,GAAU,MAAM,CAAC,MAAW,aAAa,IAAI,GAAG,iCAAiC,KAAK,IAAI,IAAI,EACzG,KAAK,eAAe,MAAM,qCAAqC,KAAK,IAAI,GAAG;AAEhF,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { Id, Tester, UseCase } from '../utils/Types';
2
+ export declare const toBeAt: (tester?: Tester, uc?: UseCase, id?: Id) => jest.CustomMatcherResult;
3
+ declare global {
4
+ namespace jest {
5
+ interface Matchers<R, T> {
6
+ toBeAt(uc?: UseCase, id?: Id): R;
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
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 toBeAt_exports = {};
20
+ __export(toBeAt_exports, {
21
+ toBeAt: () => toBeAt
22
+ });
23
+ module.exports = __toCommonJS(toBeAt_exports);
24
+ var import_Match = require("./Match");
25
+ const toBeAt = (tester, uc, id) => {
26
+ return (0, import_Match.match)(tester).undefined((t) => t, "Tester is undefined").undefined((t) => t.url, "Tester does not contain a URL").undefined(() => uc, "Use case is undefined").not(
27
+ (t) => t.url.includes(`/${uc?.app.id}`),
28
+ (t) => `We expected the tester to be at app '${uc?.app.id}', but it is at '${t?.url}' instead.`
29
+ ).not(
30
+ (t) => t.url.includes(`/${uc?.id}`),
31
+ (t) => `We expected the tester to be at use case '${uc?.id}', but it is at '${t?.url}' instead.`
32
+ ).not(
33
+ (t) => t.url.includes(id ? `/${id}` : ""),
34
+ (t) => `We expected the path to contain '/42', but it is '${t?.url}' instead.`
35
+ ).else((t) => `The tester is at '${t?.url}'`);
36
+ };
37
+ expect.extend({
38
+ toBeAt
39
+ });
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ toBeAt
43
+ });
44
+ //# sourceMappingURL=toBeAt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeAt.ts"],"sourcesContent":["import { Id, Tester, UseCase } from '../utils/Types';\nimport { match } from './Match';\n\nexport const toBeAt = (tester?: Tester, uc?: UseCase, id?: Id): jest.CustomMatcherResult => {\n return match<Tester>(tester as Tester)\n .undefined(t => t, 'Tester is undefined')\n .undefined(t => t.url, 'Tester does not contain a URL')\n .undefined(() => uc, 'Use case is undefined')\n .not(\n t => t.url.includes(`/${uc?.app.id}`),\n t => `We expected the tester to be at app '${uc?.app.id}', but it is at '${t?.url}' instead.`\n )\n .not(\n t => t.url.includes(`/${uc?.id}`),\n t => `We expected the tester to be at use case '${uc?.id}', but it is at '${t?.url}' instead.`\n )\n .not(\n t => t.url.includes(id ? `/${id}` : ''),\n t => `We expected the path to contain '/42', but it is '${t?.url}' instead.`\n )\n .else(t => `The tester is at '${t?.url}'`);\n};\n\nexpect.extend({\n toBeAt,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeAt(uc?: UseCase, id?: Id): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAsB;AAEf,MAAM,SAAS,CAAC,QAAiB,IAAc,OAAsC;AAC1F,aAAO,oBAAc,MAAgB,EAClC,UAAU,OAAK,GAAG,qBAAqB,EACvC,UAAU,OAAK,EAAE,KAAK,+BAA+B,EACrD,UAAU,MAAM,IAAI,uBAAuB,EAC3C;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,IAAI,IAAI,IAAI,EAAE,EAAE;AAAA,IACpC,OAAK,wCAAwC,IAAI,IAAI,EAAE,oBAAoB,GAAG,GAAG;AAAA,EACnF,EACC;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,IAAI,IAAI,EAAE,EAAE;AAAA,IAChC,OAAK,6CAA6C,IAAI,EAAE,oBAAoB,GAAG,GAAG;AAAA,EACpF,EACC;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,IACtC,OAAK,qDAAqD,GAAG,GAAG;AAAA,EAClE,EACC,KAAK,OAAK,qBAAqB,GAAG,GAAG,GAAG;AAC7C;AAEA,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,20 @@
1
+ import { match } from "./Match";
2
+ const toBeAt = (tester, uc, id) => {
3
+ return match(tester).undefined((t) => t, "Tester is undefined").undefined((t) => t.url, "Tester does not contain a URL").undefined(() => uc, "Use case is undefined").not(
4
+ (t) => t.url.includes(`/${uc?.app.id}`),
5
+ (t) => `We expected the tester to be at app '${uc?.app.id}', but it is at '${t?.url}' instead.`
6
+ ).not(
7
+ (t) => t.url.includes(`/${uc?.id}`),
8
+ (t) => `We expected the tester to be at use case '${uc?.id}', but it is at '${t?.url}' instead.`
9
+ ).not(
10
+ (t) => t.url.includes(id ? `/${id}` : ""),
11
+ (t) => `We expected the path to contain '/42', but it is '${t?.url}' instead.`
12
+ ).else((t) => `The tester is at '${t?.url}'`);
13
+ };
14
+ expect.extend({
15
+ toBeAt
16
+ });
17
+ export {
18
+ toBeAt
19
+ };
20
+ //# sourceMappingURL=toBeAt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeAt.ts"],"sourcesContent":["import { Id, Tester, UseCase } from '../utils/Types';\nimport { match } from './Match';\n\nexport const toBeAt = (tester?: Tester, uc?: UseCase, id?: Id): jest.CustomMatcherResult => {\n return match<Tester>(tester as Tester)\n .undefined(t => t, 'Tester is undefined')\n .undefined(t => t.url, 'Tester does not contain a URL')\n .undefined(() => uc, 'Use case is undefined')\n .not(\n t => t.url.includes(`/${uc?.app.id}`),\n t => `We expected the tester to be at app '${uc?.app.id}', but it is at '${t?.url}' instead.`\n )\n .not(\n t => t.url.includes(`/${uc?.id}`),\n t => `We expected the tester to be at use case '${uc?.id}', but it is at '${t?.url}' instead.`\n )\n .not(\n t => t.url.includes(id ? `/${id}` : ''),\n t => `We expected the path to contain '/42', but it is '${t?.url}' instead.`\n )\n .else(t => `The tester is at '${t?.url}'`);\n};\n\nexpect.extend({\n toBeAt,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeAt(uc?: UseCase, id?: Id): R;\n }\n }\n}\n"],"mappings":"AACA,SAAS,aAAa;AAEf,MAAM,SAAS,CAAC,QAAiB,IAAc,OAAsC;AAC1F,SAAO,MAAc,MAAgB,EAClC,UAAU,OAAK,GAAG,qBAAqB,EACvC,UAAU,OAAK,EAAE,KAAK,+BAA+B,EACrD,UAAU,MAAM,IAAI,uBAAuB,EAC3C;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,IAAI,IAAI,IAAI,EAAE,EAAE;AAAA,IACpC,OAAK,wCAAwC,IAAI,IAAI,EAAE,oBAAoB,GAAG,GAAG;AAAA,EACnF,EACC;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,IAAI,IAAI,EAAE,EAAE;AAAA,IAChC,OAAK,6CAA6C,IAAI,EAAE,oBAAoB,GAAG,GAAG;AAAA,EACpF,EACC;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE,KAAK,EAAE;AAAA,IACtC,OAAK,qDAAqD,GAAG,GAAG;AAAA,EAClE,EACC,KAAK,OAAK,qBAAqB,GAAG,GAAG,GAAG;AAC7C;AAEA,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { Id, Tester, UseCase } from '../utils/Types';
2
+ export declare const toBeExactlyAt: (tester?: Tester, uc?: UseCase, id?: Id) => jest.CustomMatcherResult;
3
+ declare global {
4
+ namespace jest {
5
+ interface Matchers<R, T> {
6
+ toBeExactlyAt(uc?: UseCase, id?: Id): R;
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
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 toBeExactlyAt_exports = {};
20
+ __export(toBeExactlyAt_exports, {
21
+ toBeExactlyAt: () => toBeExactlyAt
22
+ });
23
+ module.exports = __toCommonJS(toBeExactlyAt_exports);
24
+ var import_Utils = require("../utils/Utils");
25
+ var import_Match = require("./Match");
26
+ const toUrl = (uc, id) => {
27
+ const i = (0, import_Utils.isDefined)(id) ? `/${id}` : "";
28
+ return `/${uc.app.id}/${uc.id}${i}`;
29
+ };
30
+ const toBeExactlyAt = (tester, uc, id) => {
31
+ return (0, import_Match.match)(tester).undefined((t) => t, "Tester is undefined").undefined((t) => t.url, "Tester does not contain a URL").undefined(() => uc, "Use case is undefined").not(
32
+ (t) => t.url.includes(toUrl(uc, id)),
33
+ (t) => `We expected the tester to be at: '${toUrl(uc, id)}', but it is at: '${t?.url}' instead.`
34
+ ).else((t) => `The tester is at '${t?.url}'`);
35
+ };
36
+ expect.extend({
37
+ toBeExactlyAt
38
+ });
39
+ // Annotate the CommonJS export names for ESM import in node:
40
+ 0 && (module.exports = {
41
+ toBeExactlyAt
42
+ });
43
+ //# sourceMappingURL=toBeExactlyAt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeExactlyAt.ts"],"sourcesContent":["import { Id, Tester, UseCase } from '../utils/Types';\nimport { isDefined } from '../utils/Utils';\nimport { match } from './Match';\n\nconst toUrl = (uc: UseCase, id?: Id): string => {\n const i = isDefined(id) ? `/${id}` : '';\n return `/${uc.app.id}/${uc.id}${i}`;\n};\n\nexport const toBeExactlyAt = (tester?: Tester, uc?: UseCase, id?: Id): jest.CustomMatcherResult => {\n return match<Tester>(tester as Tester)\n .undefined(t => t, 'Tester is undefined')\n .undefined(t => t.url, 'Tester does not contain a URL')\n .undefined(() => uc, 'Use case is undefined')\n .not(\n t => t.url.includes(toUrl(uc as UseCase, id)),\n t => `We expected the tester to be at: '${toUrl(uc as UseCase, id)}', but it is at: '${t?.url}' instead.`\n )\n .else(t => `The tester is at '${t?.url}'`);\n};\n\nexpect.extend({\n toBeExactlyAt,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeExactlyAt(uc?: UseCase, id?: Id): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA0B;AAC1B,mBAAsB;AAEtB,MAAM,QAAQ,CAAC,IAAa,OAAoB;AAC9C,QAAM,QAAI,wBAAU,EAAE,IAAI,IAAI,EAAE,KAAK;AACrC,SAAO,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC;AACnC;AAEO,MAAM,gBAAgB,CAAC,QAAiB,IAAc,OAAsC;AACjG,aAAO,oBAAc,MAAgB,EAClC,UAAU,OAAK,GAAG,qBAAqB,EACvC,UAAU,OAAK,EAAE,KAAK,+BAA+B,EACrD,UAAU,MAAM,IAAI,uBAAuB,EAC3C;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,MAAM,IAAe,EAAE,CAAC;AAAA,IAC5C,OAAK,qCAAqC,MAAM,IAAe,EAAE,CAAC,qBAAqB,GAAG,GAAG;AAAA,EAC/F,EACC,KAAK,OAAK,qBAAqB,GAAG,GAAG,GAAG;AAC7C;AAEA,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,19 @@
1
+ import { isDefined } from "../utils/Utils";
2
+ import { match } from "./Match";
3
+ const toUrl = (uc, id) => {
4
+ const i = isDefined(id) ? `/${id}` : "";
5
+ return `/${uc.app.id}/${uc.id}${i}`;
6
+ };
7
+ const toBeExactlyAt = (tester, uc, id) => {
8
+ return match(tester).undefined((t) => t, "Tester is undefined").undefined((t) => t.url, "Tester does not contain a URL").undefined(() => uc, "Use case is undefined").not(
9
+ (t) => t.url.includes(toUrl(uc, id)),
10
+ (t) => `We expected the tester to be at: '${toUrl(uc, id)}', but it is at: '${t?.url}' instead.`
11
+ ).else((t) => `The tester is at '${t?.url}'`);
12
+ };
13
+ expect.extend({
14
+ toBeExactlyAt
15
+ });
16
+ export {
17
+ toBeExactlyAt
18
+ };
19
+ //# sourceMappingURL=toBeExactlyAt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeExactlyAt.ts"],"sourcesContent":["import { Id, Tester, UseCase } from '../utils/Types';\nimport { isDefined } from '../utils/Utils';\nimport { match } from './Match';\n\nconst toUrl = (uc: UseCase, id?: Id): string => {\n const i = isDefined(id) ? `/${id}` : '';\n return `/${uc.app.id}/${uc.id}${i}`;\n};\n\nexport const toBeExactlyAt = (tester?: Tester, uc?: UseCase, id?: Id): jest.CustomMatcherResult => {\n return match<Tester>(tester as Tester)\n .undefined(t => t, 'Tester is undefined')\n .undefined(t => t.url, 'Tester does not contain a URL')\n .undefined(() => uc, 'Use case is undefined')\n .not(\n t => t.url.includes(toUrl(uc as UseCase, id)),\n t => `We expected the tester to be at: '${toUrl(uc as UseCase, id)}', but it is at: '${t?.url}' instead.`\n )\n .else(t => `The tester is at '${t?.url}'`);\n};\n\nexpect.extend({\n toBeExactlyAt,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeExactlyAt(uc?: UseCase, id?: Id): R;\n }\n }\n}\n"],"mappings":"AACA,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AAEtB,MAAM,QAAQ,CAAC,IAAa,OAAoB;AAC9C,QAAM,IAAI,UAAU,EAAE,IAAI,IAAI,EAAE,KAAK;AACrC,SAAO,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC;AACnC;AAEO,MAAM,gBAAgB,CAAC,QAAiB,IAAc,OAAsC;AACjG,SAAO,MAAc,MAAgB,EAClC,UAAU,OAAK,GAAG,qBAAqB,EACvC,UAAU,OAAK,EAAE,KAAK,+BAA+B,EACrD,UAAU,MAAM,IAAI,uBAAuB,EAC3C;AAAA,IACC,OAAK,EAAE,IAAI,SAAS,MAAM,IAAe,EAAE,CAAC;AAAA,IAC5C,OAAK,qCAAqC,MAAM,IAAe,EAAE,CAAC,qBAAqB,GAAG,GAAG;AAAA,EAC/F,EACC,KAAK,OAAK,qBAAqB,GAAG,GAAG,GAAG;AAC7C;AAEA,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { Query } from '../utils/Types';
2
+ export declare const toBeQueriedWith: (query: jest.Mock, expected: Query) => jest.CustomMatcherResult;
3
+ declare global {
4
+ namespace jest {
5
+ interface Matchers<R, T> {
6
+ toBeQueriedWith(expected: Query): R;
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
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 toBeQueriedWith_exports = {};
20
+ __export(toBeQueriedWith_exports, {
21
+ toBeQueriedWith: () => toBeQueriedWith
22
+ });
23
+ module.exports = __toCommonJS(toBeQueriedWith_exports);
24
+ var import_Match = require("./Match");
25
+ const toBeQueriedWith = (query, expected) => (0, import_Match.match)(query?.mock?.calls).undefined((c) => c, "Query is unknown.").not((c) => c.length === 1, "Query did not execute.").not(
26
+ (c) => c[0][0].toString() === expected?.toString(),
27
+ (c) => `We expected query '${expected}', but we received query '${c[0][0]}' instead.`
28
+ ).else(`Received query does match '${expected}'`);
29
+ expect.extend({
30
+ toBeQueriedWith
31
+ });
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ toBeQueriedWith
35
+ });
36
+ //# sourceMappingURL=toBeQueriedWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeQueriedWith.ts"],"sourcesContent":["import { match } from './Match';\nimport { Query } from '../utils/Types';\n\nexport const toBeQueriedWith = (query: jest.Mock, expected: Query): jest.CustomMatcherResult =>\n match<any[]>(query?.mock?.calls)\n .undefined(c => c, 'Query is unknown.')\n .not(c => c.length === 1, 'Query did not execute.')\n .not(\n c => c[0][0].toString() === expected?.toString(),\n c => `We expected query '${expected}', but we received query '${c[0][0]}' instead.`\n )\n .else(`Received query does match '${expected}'`);\n\nexpect.extend({\n toBeQueriedWith: toBeQueriedWith,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeQueriedWith(expected: Query): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAGf,MAAM,kBAAkB,CAAC,OAAkB,iBAChD,oBAAa,OAAO,MAAM,KAAK,EAC5B,UAAU,OAAK,GAAG,mBAAmB,EACrC,IAAI,OAAK,EAAE,WAAW,GAAG,wBAAwB,EACjD;AAAA,EACC,OAAK,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAAA,EAC/C,OAAK,sBAAsB,QAAQ,6BAA6B,EAAE,CAAC,EAAE,CAAC,CAAC;AACzE,EACC,KAAK,8BAA8B,QAAQ,GAAG;AAEnD,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,12 @@
1
+ import { match } from "./Match";
2
+ const toBeQueriedWith = (query, expected) => match(query?.mock?.calls).undefined((c) => c, "Query is unknown.").not((c) => c.length === 1, "Query did not execute.").not(
3
+ (c) => c[0][0].toString() === expected?.toString(),
4
+ (c) => `We expected query '${expected}', but we received query '${c[0][0]}' instead.`
5
+ ).else(`Received query does match '${expected}'`);
6
+ expect.extend({
7
+ toBeQueriedWith
8
+ });
9
+ export {
10
+ toBeQueriedWith
11
+ };
12
+ //# sourceMappingURL=toBeQueriedWith.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeQueriedWith.ts"],"sourcesContent":["import { match } from './Match';\nimport { Query } from '../utils/Types';\n\nexport const toBeQueriedWith = (query: jest.Mock, expected: Query): jest.CustomMatcherResult =>\n match<any[]>(query?.mock?.calls)\n .undefined(c => c, 'Query is unknown.')\n .not(c => c.length === 1, 'Query did not execute.')\n .not(\n c => c[0][0].toString() === expected?.toString(),\n c => `We expected query '${expected}', but we received query '${c[0][0]}' instead.`\n )\n .else(`Received query does match '${expected}'`);\n\nexpect.extend({\n toBeQueriedWith: toBeQueriedWith,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeQueriedWith(expected: Query): R;\n }\n }\n}\n"],"mappings":"AAAA,SAAS,aAAa;AAGf,MAAM,kBAAkB,CAAC,OAAkB,aAChD,MAAa,OAAO,MAAM,KAAK,EAC5B,UAAU,OAAK,GAAG,mBAAmB,EACrC,IAAI,OAAK,EAAE,WAAW,GAAG,wBAAwB,EACjD;AAAA,EACC,OAAK,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAAA,EAC/C,OAAK,sBAAsB,QAAQ,6BAA6B,EAAE,CAAC,EAAE,CAAC,CAAC;AACzE,EACC,KAAK,8BAA8B,QAAQ,GAAG;AAEnD,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { Uri } from '../utils/Types';
2
+ export declare const toBeRoutedTo: (query: jest.Mock, expected: Uri) => jest.CustomMatcherResult;
3
+ declare global {
4
+ namespace jest {
5
+ interface Matchers<R, T> {
6
+ toBeRoutedTo(uri: Uri): R;
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
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 toBeRoutedTo_exports = {};
20
+ __export(toBeRoutedTo_exports, {
21
+ toBeRoutedTo: () => toBeRoutedTo
22
+ });
23
+ module.exports = __toCommonJS(toBeRoutedTo_exports);
24
+ var import_Match = require("./Match");
25
+ var import_Utils = require("../utils/Utils");
26
+ const toBeRoutedTo = (query, expected) => (0, import_Match.match)(query?.mock?.calls).undefined((c) => c, "Uri is unknown.").not((c) => c.length === 1, "Method was not called.").not(
27
+ (c) => (0, import_Utils.asString)(c[0][0]) === (0, import_Utils.asString)(expected),
28
+ (c) => `We expected uri '${(0, import_Utils.asString)(expected)}', but we received uri '${(0, import_Utils.asString)(c[0][0])}' instead.`
29
+ ).else(`Called uri does match '${(0, import_Utils.asString)(expected)}'`);
30
+ expect.extend({
31
+ toBeRoutedTo
32
+ });
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ toBeRoutedTo
36
+ });
37
+ //# sourceMappingURL=toBeRoutedTo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeRoutedTo.ts"],"sourcesContent":["import { match } from './Match';\nimport { Uri } from '../utils/Types';\nimport { asString } from '../utils/Utils';\n\nexport const toBeRoutedTo = (query: jest.Mock, expected: Uri): jest.CustomMatcherResult =>\n match<any[]>(query?.mock?.calls)\n .undefined(c => c, 'Uri is unknown.')\n .not(c => c.length === 1, 'Method was not called.')\n .not(\n c => asString(c[0][0]) === asString(expected),\n c => `We expected uri '${asString(expected)}', but we received uri '${asString(c[0][0])}' instead.`\n )\n .else(`Called uri does match '${asString(expected)}'`);\n\nexpect.extend({\n toBeRoutedTo: toBeRoutedTo,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeRoutedTo(uri: Uri): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAEtB,mBAAyB;AAElB,MAAM,eAAe,CAAC,OAAkB,iBAC7C,oBAAa,OAAO,MAAM,KAAK,EAC5B,UAAU,OAAK,GAAG,iBAAiB,EACnC,IAAI,OAAK,EAAE,WAAW,GAAG,wBAAwB,EACjD;AAAA,EACC,WAAK,uBAAS,EAAE,CAAC,EAAE,CAAC,CAAC,UAAM,uBAAS,QAAQ;AAAA,EAC5C,OAAK,wBAAoB,uBAAS,QAAQ,CAAC,+BAA2B,uBAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACzF,EACC,KAAK,8BAA0B,uBAAS,QAAQ,CAAC,GAAG;AAEzD,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,13 @@
1
+ import { match } from "./Match";
2
+ import { asString } from "../utils/Utils";
3
+ const toBeRoutedTo = (query, expected) => match(query?.mock?.calls).undefined((c) => c, "Uri is unknown.").not((c) => c.length === 1, "Method was not called.").not(
4
+ (c) => asString(c[0][0]) === asString(expected),
5
+ (c) => `We expected uri '${asString(expected)}', but we received uri '${asString(c[0][0])}' instead.`
6
+ ).else(`Called uri does match '${asString(expected)}'`);
7
+ expect.extend({
8
+ toBeRoutedTo
9
+ });
10
+ export {
11
+ toBeRoutedTo
12
+ };
13
+ //# sourceMappingURL=toBeRoutedTo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeRoutedTo.ts"],"sourcesContent":["import { match } from './Match';\nimport { Uri } from '../utils/Types';\nimport { asString } from '../utils/Utils';\n\nexport const toBeRoutedTo = (query: jest.Mock, expected: Uri): jest.CustomMatcherResult =>\n match<any[]>(query?.mock?.calls)\n .undefined(c => c, 'Uri is unknown.')\n .not(c => c.length === 1, 'Method was not called.')\n .not(\n c => asString(c[0][0]) === asString(expected),\n c => `We expected uri '${asString(expected)}', but we received uri '${asString(c[0][0])}' instead.`\n )\n .else(`Called uri does match '${asString(expected)}'`);\n\nexpect.extend({\n toBeRoutedTo: toBeRoutedTo,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeRoutedTo(uri: Uri): R;\n }\n }\n}\n"],"mappings":"AAAA,SAAS,aAAa;AAEtB,SAAS,gBAAgB;AAElB,MAAM,eAAe,CAAC,OAAkB,aAC7C,MAAa,OAAO,MAAM,KAAK,EAC5B,UAAU,OAAK,GAAG,iBAAiB,EACnC,IAAI,OAAK,EAAE,WAAW,GAAG,wBAAwB,EACjD;AAAA,EACC,OAAK,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,SAAS,QAAQ;AAAA,EAC5C,OAAK,oBAAoB,SAAS,QAAQ,CAAC,2BAA2B,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACzF,EACC,KAAK,0BAA0B,SAAS,QAAQ,CAAC,GAAG;AAEzD,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,8 @@
1
+ export declare const toBeValid: (v?: unknown) => jest.CustomMatcherResult;
2
+ declare global {
3
+ namespace jest {
4
+ interface Matchers<R, T> {
5
+ toBeValid(): R;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
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 toBeValid_exports = {};
20
+ __export(toBeValid_exports, {
21
+ toBeValid: () => toBeValid
22
+ });
23
+ module.exports = __toCommonJS(toBeValid_exports);
24
+ var import_Utils = require("../utils/Utils");
25
+ var import_Match = require("./Match");
26
+ const toBeValid = (v) => (0, import_Match.match)(v).undefined((s) => s, "Subject is undefined.").not((s) => (0, import_Utils.isA)(s, "isValid"), "Subject is not validatable.").not((s) => s.isValid, `Subject is not valid.`).else(`Subject is valid`);
27
+ expect.extend({
28
+ toBeValid
29
+ });
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ toBeValid
33
+ });
34
+ //# sourceMappingURL=toBeValid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeValid.ts"],"sourcesContent":["import { Validatable } from '../utils/Types';\nimport { isA } from '../utils/Utils';\nimport { match } from './Match';\n\nexport const toBeValid = (v?: unknown): jest.CustomMatcherResult =>\n match<Validatable>(v as Validatable)\n .undefined(s => s, 'Subject is undefined.')\n .not(s => isA<Validatable>(s, 'isValid'), 'Subject is not validatable.')\n .not(s => s.isValid, `Subject is not valid.`)\n .else(`Subject is valid`);\n\nexpect.extend({\n toBeValid,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeValid(): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAoB;AACpB,mBAAsB;AAEf,MAAM,YAAY,CAAC,UACxB,oBAAmB,CAAgB,EAChC,UAAU,OAAK,GAAG,uBAAuB,EACzC,IAAI,WAAK,kBAAiB,GAAG,SAAS,GAAG,6BAA6B,EACtE,IAAI,OAAK,EAAE,SAAS,uBAAuB,EAC3C,KAAK,kBAAkB;AAE5B,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,10 @@
1
+ import { isA } from "../utils/Utils";
2
+ import { match } from "./Match";
3
+ const toBeValid = (v) => match(v).undefined((s) => s, "Subject is undefined.").not((s) => isA(s, "isValid"), "Subject is not validatable.").not((s) => s.isValid, `Subject is not valid.`).else(`Subject is valid`);
4
+ expect.extend({
5
+ toBeValid
6
+ });
7
+ export {
8
+ toBeValid
9
+ };
10
+ //# sourceMappingURL=toBeValid.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toBeValid.ts"],"sourcesContent":["import { Validatable } from '../utils/Types';\nimport { isA } from '../utils/Utils';\nimport { match } from './Match';\n\nexport const toBeValid = (v?: unknown): jest.CustomMatcherResult =>\n match<Validatable>(v as Validatable)\n .undefined(s => s, 'Subject is undefined.')\n .not(s => isA<Validatable>(s, 'isValid'), 'Subject is not validatable.')\n .not(s => s.isValid, `Subject is not valid.`)\n .else(`Subject is valid`);\n\nexpect.extend({\n toBeValid,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeValid(): R;\n }\n }\n}\n"],"mappings":"AACA,SAAS,WAAW;AACpB,SAAS,aAAa;AAEf,MAAM,YAAY,CAAC,MACxB,MAAmB,CAAgB,EAChC,UAAU,OAAK,GAAG,uBAAuB,EACzC,IAAI,OAAK,IAAiB,GAAG,SAAS,GAAG,6BAA6B,EACtE,IAAI,OAAK,EAAE,SAAS,uBAAuB,EAC3C,KAAK,kBAAkB;AAE5B,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,19 @@
1
+ import { Message } from '../utils/Types';
2
+ export declare const Fails: {
3
+ Yes: string;
4
+ No: (reason: string) => string;
5
+ };
6
+ export declare const FailsWith: {
7
+ Yes: string;
8
+ No: (message: string, instead: string) => string;
9
+ };
10
+ export declare const toFailMatcher: (result: jest.CustomMatcherResult) => jest.CustomMatcherResult;
11
+ export declare const toFailMatcherWith: (result: jest.CustomMatcherResult, message: Message<jest.CustomMatcherResult>) => jest.CustomMatcherResult;
12
+ declare global {
13
+ namespace jest {
14
+ interface Matchers<R, T> {
15
+ toFailMatcher(): R;
16
+ toFailMatcherWith(message: string): R;
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
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 toFailMatcher_exports = {};
20
+ __export(toFailMatcher_exports, {
21
+ Fails: () => Fails,
22
+ FailsWith: () => FailsWith,
23
+ toFailMatcher: () => toFailMatcher,
24
+ toFailMatcherWith: () => toFailMatcherWith
25
+ });
26
+ module.exports = __toCommonJS(toFailMatcher_exports);
27
+ var import_Match = require("./Match");
28
+ var import_Types = require("../utils/Types");
29
+ const Fails = {
30
+ Yes: "Match fails, instead of passes.",
31
+ No: (reason) => `Match doesn't fail, because '${reason}'`
32
+ };
33
+ const FailsWith = {
34
+ Yes: "Match fails with correct message.",
35
+ No: (message, instead) => `Match does fail, however not with message '${message}', but with message '${instead}' instead.`
36
+ };
37
+ const toFailMatcher = (result) => (0, import_Match.match)(result).not(
38
+ (c) => !c.pass,
39
+ (c) => Fails.No(c.message())
40
+ ).else(Fails.Yes);
41
+ const toFailMatcherWith = (result, message) => (0, import_Match.match)(result).not(
42
+ (c) => !c.pass,
43
+ (c) => Fails.No(c.message())
44
+ ).not(
45
+ (c) => c.message().includes((0, import_Types.toMessage)(message)),
46
+ (c) => FailsWith.No((0, import_Types.toMessage)(message), c.message())
47
+ ).else(FailsWith.Yes);
48
+ expect.extend({
49
+ toFailMatcher,
50
+ toFailMatcherWith
51
+ });
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ Fails,
55
+ FailsWith,
56
+ toFailMatcher,
57
+ toFailMatcherWith
58
+ });
59
+ //# sourceMappingURL=toFailMatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toFailMatcher.ts"],"sourcesContent":["import { match } from './Match';\nimport { Message, toMessage } from '../utils/Types';\n\n// Handles CustomMatcherResult validations.\n\nexport const Fails = {\n Yes: 'Match fails, instead of passes.',\n No: (reason: string): string => `Match doesn't fail, because '${reason}'`,\n};\n\nexport const FailsWith = {\n Yes: 'Match fails with correct message.',\n No: (message: string, instead: string): string => `Match does fail, however not with message '${message}', but with message '${instead}' instead.`,\n};\n\nexport const toFailMatcher = (result: jest.CustomMatcherResult): jest.CustomMatcherResult =>\n match(result)\n .not(\n c => !c.pass,\n c => Fails.No(c.message())\n )\n .else(Fails.Yes);\n\nexport const toFailMatcherWith = (result: jest.CustomMatcherResult, message: Message<jest.CustomMatcherResult>): jest.CustomMatcherResult =>\n match(result)\n .not(\n c => !c.pass,\n c => Fails.No(c.message())\n )\n .not(\n c => c.message().includes(toMessage(message)),\n c => FailsWith.No(toMessage(message), c.message())\n )\n .else(FailsWith.Yes);\n\nexpect.extend({\n toFailMatcher: toFailMatcher,\n toFailMatcherWith: toFailMatcherWith,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toFailMatcher(): R;\n\n toFailMatcherWith(message: string): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AACtB,mBAAmC;AAI5B,MAAM,QAAQ;AAAA,EACnB,KAAK;AAAA,EACL,IAAI,CAAC,WAA2B,gCAAgC,MAAM;AACxE;AAEO,MAAM,YAAY;AAAA,EACvB,KAAK;AAAA,EACL,IAAI,CAAC,SAAiB,YAA4B,8CAA8C,OAAO,wBAAwB,OAAO;AACxI;AAEO,MAAM,gBAAgB,CAAC,eAC5B,oBAAM,MAAM,EACT;AAAA,EACC,OAAK,CAAC,EAAE;AAAA,EACR,OAAK,MAAM,GAAG,EAAE,QAAQ,CAAC;AAC3B,EACC,KAAK,MAAM,GAAG;AAEZ,MAAM,oBAAoB,CAAC,QAAkC,gBAClE,oBAAM,MAAM,EACT;AAAA,EACC,OAAK,CAAC,EAAE;AAAA,EACR,OAAK,MAAM,GAAG,EAAE,QAAQ,CAAC;AAC3B,EACC;AAAA,EACC,OAAK,EAAE,QAAQ,EAAE,aAAS,wBAAU,OAAO,CAAC;AAAA,EAC5C,OAAK,UAAU,OAAG,wBAAU,OAAO,GAAG,EAAE,QAAQ,CAAC;AACnD,EACC,KAAK,UAAU,GAAG;AAEvB,OAAO,OAAO;AAAA,EACZ;AAAA,EACA;AACF,CAAC;","names":[]}
@@ -0,0 +1,32 @@
1
+ import { match } from "./Match";
2
+ import { toMessage } from "../utils/Types";
3
+ const Fails = {
4
+ Yes: "Match fails, instead of passes.",
5
+ No: (reason) => `Match doesn't fail, because '${reason}'`
6
+ };
7
+ const FailsWith = {
8
+ Yes: "Match fails with correct message.",
9
+ No: (message, instead) => `Match does fail, however not with message '${message}', but with message '${instead}' instead.`
10
+ };
11
+ const toFailMatcher = (result) => match(result).not(
12
+ (c) => !c.pass,
13
+ (c) => Fails.No(c.message())
14
+ ).else(Fails.Yes);
15
+ const toFailMatcherWith = (result, message) => match(result).not(
16
+ (c) => !c.pass,
17
+ (c) => Fails.No(c.message())
18
+ ).not(
19
+ (c) => c.message().includes(toMessage(message)),
20
+ (c) => FailsWith.No(toMessage(message), c.message())
21
+ ).else(FailsWith.Yes);
22
+ expect.extend({
23
+ toFailMatcher,
24
+ toFailMatcherWith
25
+ });
26
+ export {
27
+ Fails,
28
+ FailsWith,
29
+ toFailMatcher,
30
+ toFailMatcherWith
31
+ };
32
+ //# sourceMappingURL=toFailMatcher.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toFailMatcher.ts"],"sourcesContent":["import { match } from './Match';\nimport { Message, toMessage } from '../utils/Types';\n\n// Handles CustomMatcherResult validations.\n\nexport const Fails = {\n Yes: 'Match fails, instead of passes.',\n No: (reason: string): string => `Match doesn't fail, because '${reason}'`,\n};\n\nexport const FailsWith = {\n Yes: 'Match fails with correct message.',\n No: (message: string, instead: string): string => `Match does fail, however not with message '${message}', but with message '${instead}' instead.`,\n};\n\nexport const toFailMatcher = (result: jest.CustomMatcherResult): jest.CustomMatcherResult =>\n match(result)\n .not(\n c => !c.pass,\n c => Fails.No(c.message())\n )\n .else(Fails.Yes);\n\nexport const toFailMatcherWith = (result: jest.CustomMatcherResult, message: Message<jest.CustomMatcherResult>): jest.CustomMatcherResult =>\n match(result)\n .not(\n c => !c.pass,\n c => Fails.No(c.message())\n )\n .not(\n c => c.message().includes(toMessage(message)),\n c => FailsWith.No(toMessage(message), c.message())\n )\n .else(FailsWith.Yes);\n\nexpect.extend({\n toFailMatcher: toFailMatcher,\n toFailMatcherWith: toFailMatcherWith,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toFailMatcher(): R;\n\n toFailMatcherWith(message: string): R;\n }\n }\n}\n"],"mappings":"AAAA,SAAS,aAAa;AACtB,SAAkB,iBAAiB;AAI5B,MAAM,QAAQ;AAAA,EACnB,KAAK;AAAA,EACL,IAAI,CAAC,WAA2B,gCAAgC,MAAM;AACxE;AAEO,MAAM,YAAY;AAAA,EACvB,KAAK;AAAA,EACL,IAAI,CAAC,SAAiB,YAA4B,8CAA8C,OAAO,wBAAwB,OAAO;AACxI;AAEO,MAAM,gBAAgB,CAAC,WAC5B,MAAM,MAAM,EACT;AAAA,EACC,OAAK,CAAC,EAAE;AAAA,EACR,OAAK,MAAM,GAAG,EAAE,QAAQ,CAAC;AAC3B,EACC,KAAK,MAAM,GAAG;AAEZ,MAAM,oBAAoB,CAAC,QAAkC,YAClE,MAAM,MAAM,EACT;AAAA,EACC,OAAK,CAAC,EAAE;AAAA,EACR,OAAK,MAAM,GAAG,EAAE,QAAQ,CAAC;AAC3B,EACC;AAAA,EACC,OAAK,EAAE,QAAQ,EAAE,SAAS,UAAU,OAAO,CAAC;AAAA,EAC5C,OAAK,UAAU,GAAG,UAAU,OAAO,GAAG,EAAE,QAAQ,CAAC;AACnD,EACC,KAAK,UAAU,GAAG;AAEvB,OAAO,OAAO;AAAA,EACZ;AAAA,EACA;AACF,CAAC;","names":[]}
@@ -0,0 +1,9 @@
1
+ /// <reference types="jest" />
2
+ export declare function toMatchArray(this: jest.MatcherContext, received: any[], expected: any[]): jest.CustomMatcherResult;
3
+ declare global {
4
+ namespace jest {
5
+ interface Matchers<R, T> {
6
+ toMatchArray(expected: any[]): R;
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
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 toMatchArray_exports = {};
20
+ __export(toMatchArray_exports, {
21
+ toMatchArray: () => toMatchArray
22
+ });
23
+ module.exports = __toCommonJS(toMatchArray_exports);
24
+ var import_Check = require("./Check");
25
+ function toMatchArray(received, expected) {
26
+ return (0, import_Check.checkDefined)(this, received, expected).not(([r, e]) => r.length === e.length, ([r, e]) => `Received array has length ${r.length}, while expected array has length ${e.length}.`).not(([r, e]) => r.every((el, i) => this.equals(el, e[i])), "Elements in {r} do not match elements in {e}. \n\n {diff}.").else();
27
+ }
28
+ expect.extend({
29
+ toMatchArray
30
+ });
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ toMatchArray
34
+ });
35
+ //# sourceMappingURL=toMatchArray.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toMatchArray.ts"],"sourcesContent":["import { checkDefined } from \"./Check\";\n\nexport function toMatchArray(this: jest.MatcherContext, received: any[], expected: any[]) {\n return checkDefined(this, received, expected)\n .not(([r, e]) => r.length === e.length, ([r, e]) => `Received array has length ${r.length}, while expected array has length ${e.length}.`)\n .not(([r, e]) => r.every((el, i) => this.equals(el, e[i])), \"Elements in {r} do not match elements in {e}. \\n\\n {diff}.\")\n .else();\n}\n\nexpect.extend({\n toMatchArray\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toMatchArray(expected: any[]): R;\n }\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6B;AAEtB,SAAS,aAAwC,UAAiB,UAAiB;AACxF,aAAO,2BAAa,MAAM,UAAU,QAAQ,EACzC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,6BAA6B,EAAE,MAAM,qCAAqC,EAAE,MAAM,GAAG,EACxI,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,MAAM,KAAK,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,4DAA4D,EACvH,KAAK;AACV;AAEA,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,11 @@
1
+ import { checkDefined } from "./Check";
2
+ function toMatchArray(received, expected) {
3
+ return checkDefined(this, received, expected).not(([r, e]) => r.length === e.length, ([r, e]) => `Received array has length ${r.length}, while expected array has length ${e.length}.`).not(([r, e]) => r.every((el, i) => this.equals(el, e[i])), "Elements in {r} do not match elements in {e}. \n\n {diff}.").else();
4
+ }
5
+ expect.extend({
6
+ toMatchArray
7
+ });
8
+ export {
9
+ toMatchArray
10
+ };
11
+ //# sourceMappingURL=toMatchArray.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/matchers/toMatchArray.ts"],"sourcesContent":["import { checkDefined } from \"./Check\";\n\nexport function toMatchArray(this: jest.MatcherContext, received: any[], expected: any[]) {\n return checkDefined(this, received, expected)\n .not(([r, e]) => r.length === e.length, ([r, e]) => `Received array has length ${r.length}, while expected array has length ${e.length}.`)\n .not(([r, e]) => r.every((el, i) => this.equals(el, e[i])), \"Elements in {r} do not match elements in {e}. \\n\\n {diff}.\")\n .else();\n}\n\nexpect.extend({\n toMatchArray\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toMatchArray(expected: any[]): R;\n }\n }\n}"],"mappings":"AAAA,SAAS,oBAAoB;AAEtB,SAAS,aAAwC,UAAiB,UAAiB;AACxF,SAAO,aAAa,MAAM,UAAU,QAAQ,EACzC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,6BAA6B,EAAE,MAAM,qCAAqC,EAAE,MAAM,GAAG,EACxI,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,MAAM,KAAK,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,4DAA4D,EACvH,KAAK;AACV;AAEA,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
@@ -0,0 +1,14 @@
1
+ export declare const MatchesExactJson: {
2
+ SubjectUndefined: string;
3
+ SubsetUndefined: string;
4
+ DoesNotMatch: string;
5
+ Yes: string;
6
+ };
7
+ export declare const toMatchExactJson: (value?: unknown, json?: unknown) => jest.CustomMatcherResult;
8
+ declare global {
9
+ namespace jest {
10
+ interface Matchers<R, T> {
11
+ toMatchExactJson(json?: unknown): R;
12
+ }
13
+ }
14
+ }