@thisisagile/easy-test 15.26.2 → 15.27.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/dist/chunk-6EKWTLNQ.mjs +12 -0
- package/dist/chunk-6EKWTLNQ.mjs.map +1 -0
- package/dist/chunk-KAVJOG5T.mjs +39 -0
- package/dist/chunk-KAVJOG5T.mjs.map +1 -0
- package/dist/chunk-LN24S2PC.mjs +41 -0
- package/dist/chunk-LN24S2PC.mjs.map +1 -0
- package/dist/chunk-O475TEG2.mjs +30 -0
- package/dist/chunk-O475TEG2.mjs.map +1 -0
- package/dist/chunk-QE3TR4BY.mjs +16 -0
- package/dist/chunk-QE3TR4BY.mjs.map +1 -0
- package/dist/chunk-Z4XAP66Q.mjs +44 -0
- package/dist/chunk-Z4XAP66Q.mjs.map +1 -0
- package/dist/index.js +590 -5
- package/dist/index.js.map +1 -1
- package/dist/matchers/Check.mjs +5 -34
- package/dist/matchers/Check.mjs.map +1 -1
- package/dist/matchers/HttpMatchers.mjs +19 -13
- package/dist/matchers/HttpMatchers.mjs.map +1 -1
- package/dist/matchers/Match.mjs +6 -29
- package/dist/matchers/Match.mjs.map +1 -1
- package/dist/matchers/ResultMatchers.mjs +14 -8
- package/dist/matchers/ResultMatchers.mjs.map +1 -1
- package/dist/matchers/toBeArrayOf.mjs +8 -2
- package/dist/matchers/toBeArrayOf.mjs.map +1 -1
- package/dist/matchers/toBeArrayOfWithLength.mjs +8 -2
- package/dist/matchers/toBeArrayOfWithLength.mjs.map +1 -1
- package/dist/matchers/toBeAt.mjs +8 -2
- package/dist/matchers/toBeAt.mjs.map +1 -1
- package/dist/matchers/toBeExactlyAt.mjs +11 -4
- package/dist/matchers/toBeExactlyAt.mjs.map +1 -1
- package/dist/matchers/toBeQueriedWith.mjs +8 -2
- package/dist/matchers/toBeQueriedWith.mjs.map +1 -1
- package/dist/matchers/toBeRoutedTo.mjs +14 -5
- package/dist/matchers/toBeRoutedTo.mjs.map +1 -1
- package/dist/matchers/toBeValid.mjs +10 -3
- package/dist/matchers/toBeValid.mjs.map +1 -1
- package/dist/matchers/toFailMatcher.mjs +13 -6
- package/dist/matchers/toFailMatcher.mjs.map +1 -1
- package/dist/matchers/toMatchArray.mjs +6 -1
- package/dist/matchers/toMatchArray.mjs.map +1 -1
- package/dist/matchers/toMatchExactJson.mjs +12 -4
- package/dist/matchers/toMatchExactJson.mjs.map +1 -1
- package/dist/matchers/toMatchException.mjs +10 -3
- package/dist/matchers/toMatchException.mjs.map +1 -1
- package/dist/matchers/toMatchJson.mjs +14 -5
- package/dist/matchers/toMatchJson.mjs.map +1 -1
- package/dist/matchers/toMatchRoute.mjs +10 -3
- package/dist/matchers/toMatchRoute.mjs.map +1 -1
- package/dist/matchers/toMatchText.mjs +10 -3
- package/dist/matchers/toMatchText.mjs.map +1 -1
- package/dist/matchers/toPassMatcher.mjs +13 -6
- package/dist/matchers/toPassMatcher.mjs.map +1 -1
- package/dist/mock/Fits.mjs +17 -9
- package/dist/mock/Fits.mjs.map +1 -1
- package/dist/mock/Mocks.mjs +9 -4
- package/dist/mock/Mocks.mjs.map +1 -1
- package/dist/utils/Eq.mjs +4 -7
- package/dist/utils/Eq.mjs.map +1 -1
- package/dist/utils/Req.mjs +4 -29
- package/dist/utils/Req.mjs.map +1 -1
- package/dist/utils/Types.mjs +4 -2
- package/dist/utils/Types.mjs.map +1 -1
- package/dist/utils/Utils.mjs +13 -14
- package/dist/utils/Utils.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/matchers/Check.js +0 -64
- package/dist/matchers/Check.js.map +0 -1
- package/dist/matchers/HttpMatchers.js +0 -89
- package/dist/matchers/HttpMatchers.js.map +0 -1
- package/dist/matchers/Match.js +0 -59
- package/dist/matchers/Match.js.map +0 -1
- package/dist/matchers/ResultMatchers.js +0 -51
- package/dist/matchers/ResultMatchers.js.map +0 -1
- package/dist/matchers/index.js +0 -59
- package/dist/matchers/index.js.map +0 -1
- package/dist/matchers/toBeArrayOf.js +0 -33
- package/dist/matchers/toBeArrayOf.js.map +0 -1
- package/dist/matchers/toBeArrayOfWithLength.js +0 -36
- package/dist/matchers/toBeArrayOfWithLength.js.map +0 -1
- package/dist/matchers/toBeAt.js +0 -44
- package/dist/matchers/toBeAt.js.map +0 -1
- package/dist/matchers/toBeExactlyAt.js +0 -43
- package/dist/matchers/toBeExactlyAt.js.map +0 -1
- package/dist/matchers/toBeQueriedWith.js +0 -36
- package/dist/matchers/toBeQueriedWith.js.map +0 -1
- package/dist/matchers/toBeRoutedTo.js +0 -49
- package/dist/matchers/toBeRoutedTo.js.map +0 -1
- package/dist/matchers/toBeValid.js +0 -34
- package/dist/matchers/toBeValid.js.map +0 -1
- package/dist/matchers/toFailMatcher.js +0 -59
- package/dist/matchers/toFailMatcher.js.map +0 -1
- package/dist/matchers/toMatchArray.js +0 -38
- package/dist/matchers/toMatchArray.js.map +0 -1
- package/dist/matchers/toMatchExactJson.js +0 -42
- package/dist/matchers/toMatchExactJson.js.map +0 -1
- package/dist/matchers/toMatchException.js +0 -43
- package/dist/matchers/toMatchException.js.map +0 -1
- package/dist/matchers/toMatchJson.js +0 -43
- package/dist/matchers/toMatchJson.js.map +0 -1
- package/dist/matchers/toMatchRoute.js +0 -37
- package/dist/matchers/toMatchRoute.js.map +0 -1
- package/dist/matchers/toMatchText.js +0 -37
- package/dist/matchers/toMatchText.js.map +0 -1
- package/dist/matchers/toPassMatcher.js +0 -59
- package/dist/matchers/toPassMatcher.js.map +0 -1
- package/dist/mock/Fits.js +0 -71
- package/dist/mock/Fits.js.map +0 -1
- package/dist/mock/Mocks.js +0 -98
- package/dist/mock/Mocks.js.map +0 -1
- package/dist/mock/index.js +0 -25
- package/dist/mock/index.js.map +0 -1
- package/dist/utils/Eq.js +0 -35
- package/dist/utils/Eq.js.map +0 -1
- package/dist/utils/Req.js +0 -57
- package/dist/utils/Req.js.map +0 -1
- package/dist/utils/Response.js +0 -17
- package/dist/utils/Response.js.map +0 -1
- package/dist/utils/Types.js +0 -30
- package/dist/utils/Types.js.map +0 -1
- package/dist/utils/Utils.js +0 -62
- package/dist/utils/Utils.js.map +0 -1
|
@@ -1,89 +0,0 @@
|
|
|
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 HttpMatchers_exports = {};
|
|
20
|
-
__export(HttpMatchers_exports, {
|
|
21
|
-
toBeBadGateway: () => toBeBadGateway,
|
|
22
|
-
toBeBadRequest: () => toBeBadRequest,
|
|
23
|
-
toBeConflict: () => toBeConflict,
|
|
24
|
-
toBeCreated: () => toBeCreated,
|
|
25
|
-
toBeForbidden: () => toBeForbidden,
|
|
26
|
-
toBeInternalServerError: () => toBeInternalServerError,
|
|
27
|
-
toBeNotFound: () => toBeNotFound,
|
|
28
|
-
toBeOk: () => toBeOk,
|
|
29
|
-
toBeOkWithItems: () => toBeOkWithItems,
|
|
30
|
-
toBeUnauthorized: () => toBeUnauthorized,
|
|
31
|
-
toHaveNoContent: () => toHaveNoContent,
|
|
32
|
-
toHaveStatus: () => toHaveStatus
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(HttpMatchers_exports);
|
|
35
|
-
var import_Match = require("./Match");
|
|
36
|
-
const toHaveStatus = (res, code) => (0, import_Match.match)(res).undefined((r) => r, "Response is unknown.").undefined(
|
|
37
|
-
(r) => r?.status?.id,
|
|
38
|
-
() => "Response does not have a status code"
|
|
39
|
-
).not(
|
|
40
|
-
(r) => r.status.id === code,
|
|
41
|
-
(r) => `Response does not have code '${code}', but has code '${r.status.id}' instead.`
|
|
42
|
-
).else(`Response does have status code '${code}'.`);
|
|
43
|
-
const toBeOk = (res) => toHaveStatus(res, 200);
|
|
44
|
-
const toBeCreated = (res) => toHaveStatus(res, 201);
|
|
45
|
-
const toHaveNoContent = (res) => toHaveStatus(res, 204);
|
|
46
|
-
const toBeBadRequest = (res) => toHaveStatus(res, 400);
|
|
47
|
-
const toBeUnauthorized = (res) => toHaveStatus(res, 401);
|
|
48
|
-
const toBeForbidden = (res) => toHaveStatus(res, 403);
|
|
49
|
-
const toBeNotFound = (res) => toHaveStatus(res, 404);
|
|
50
|
-
const toBeConflict = (res) => toHaveStatus(res, 409);
|
|
51
|
-
const toBeInternalServerError = (res) => toHaveStatus(res, 500);
|
|
52
|
-
const toBeBadGateway = (res) => toHaveStatus(res, 502);
|
|
53
|
-
const toBeOkWithItems = (res, length) => (0, import_Match.match)(res).undefined((r) => r.status?.id, "Response did not have a status").not(
|
|
54
|
-
(r) => r.status.id === 200,
|
|
55
|
-
(r) => `Response did not have status '200'. It had status '${r.status.id}' instead.`
|
|
56
|
-
).undefined((r) => r?.body?.data?.items, `Response did not have any items.`).not(
|
|
57
|
-
(r) => (r?.body?.data?.itemCount ?? 0) >= length,
|
|
58
|
-
(r) => `Response did not have at least ${length} items. It only had ${r?.body?.data?.itemCount ?? 0} items.`
|
|
59
|
-
).else(`Response had status 200 and at least ${length} items`);
|
|
60
|
-
expect.extend({
|
|
61
|
-
toBeOk,
|
|
62
|
-
toBeOkWithItems,
|
|
63
|
-
toBeCreated,
|
|
64
|
-
toHaveNoContent,
|
|
65
|
-
toBeNotFound,
|
|
66
|
-
toBeBadRequest,
|
|
67
|
-
toBeUnauthorized,
|
|
68
|
-
toBeForbidden,
|
|
69
|
-
toBeConflict,
|
|
70
|
-
toBeInternalServerError,
|
|
71
|
-
toHaveStatus,
|
|
72
|
-
toBeBadGateway
|
|
73
|
-
});
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
toBeBadGateway,
|
|
77
|
-
toBeBadRequest,
|
|
78
|
-
toBeConflict,
|
|
79
|
-
toBeCreated,
|
|
80
|
-
toBeForbidden,
|
|
81
|
-
toBeInternalServerError,
|
|
82
|
-
toBeNotFound,
|
|
83
|
-
toBeOk,
|
|
84
|
-
toBeOkWithItems,
|
|
85
|
-
toBeUnauthorized,
|
|
86
|
-
toHaveNoContent,
|
|
87
|
-
toHaveStatus
|
|
88
|
-
});
|
|
89
|
-
//# sourceMappingURL=HttpMatchers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/matchers/HttpMatchers.ts"],"sourcesContent":["import { Response } from '../utils/Response';\nimport { match } from './Match';\n\nexport const toHaveStatus = (res: Response, code: number): jest.CustomMatcherResult =>\n match<Response>(res)\n .undefined(r => r, 'Response is unknown.')\n .undefined(\n r => r?.status?.id,\n () => 'Response does not have a status code'\n )\n .not(\n r => r.status.id === code,\n r => `Response does not have code '${code}', but has code '${r.status.id}' instead.`\n )\n .else(`Response does have status code '${code}'.`);\n\nexport const toBeOk = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 200);\n\nexport const toBeCreated = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 201);\n\nexport const toHaveNoContent = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 204);\n\nexport const toBeBadRequest = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 400);\n\nexport const toBeUnauthorized = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 401);\n\nexport const toBeForbidden = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 403);\n\nexport const toBeNotFound = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 404);\n\nexport const toBeConflict = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 409);\n\nexport const toBeInternalServerError = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 500);\n\nexport const toBeBadGateway = (res: Response): jest.CustomMatcherResult => toHaveStatus(res, 502);\n\nexport const toBeOkWithItems = (res: Response, length: number): jest.CustomMatcherResult =>\n match<Response>(res)\n .undefined(r => r.status?.id, 'Response did not have a status')\n .not(\n r => r.status.id === 200,\n r => `Response did not have status '200'. It had status '${r.status.id}' instead.`\n )\n .undefined(r => r?.body?.data?.items, `Response did not have any items.`)\n .not(\n r => (r?.body?.data?.itemCount ?? 0) >= length,\n r => `Response did not have at least ${length} items. It only had ${r?.body?.data?.itemCount ?? 0} items.`\n )\n .else(`Response had status 200 and at least ${length} items`);\n\nexpect.extend({\n toBeOk,\n toBeOkWithItems,\n toBeCreated,\n toHaveNoContent,\n toBeNotFound,\n toBeBadRequest,\n toBeUnauthorized,\n toBeForbidden,\n toBeConflict,\n toBeInternalServerError,\n toHaveStatus,\n toBeBadGateway,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeOk(): R;\n toBeOkWithItems(length: number): R;\n toBeCreated(): R;\n toHaveNoContent(): R;\n toBeNotFound(): R;\n toBeUnauthorized(): R;\n toBeForbidden(): R;\n toBeBadRequest(): R;\n toBeConflict(): R;\n toBeInternalServerError(): R;\n toBeBadGateway(): R;\n toHaveStatus(code: number): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAsB;AAEf,MAAM,eAAe,CAAC,KAAe,aAC1C,oBAAgB,GAAG,EAChB,UAAU,OAAK,GAAG,sBAAsB,EACxC;AAAA,EACC,OAAK,GAAG,QAAQ;AAAA,EAChB,MAAM;AACR,EACC;AAAA,EACC,OAAK,EAAE,OAAO,OAAO;AAAA,EACrB,OAAK,gCAAgC,IAAI,oBAAoB,EAAE,OAAO,EAAE;AAC1E,EACC,KAAK,mCAAmC,IAAI,IAAI;AAE9C,MAAM,SAAS,CAAC,QAA4C,aAAa,KAAK,GAAG;AAEjF,MAAM,cAAc,CAAC,QAA4C,aAAa,KAAK,GAAG;AAEtF,MAAM,kBAAkB,CAAC,QAA4C,aAAa,KAAK,GAAG;AAE1F,MAAM,iBAAiB,CAAC,QAA4C,aAAa,KAAK,GAAG;AAEzF,MAAM,mBAAmB,CAAC,QAA4C,aAAa,KAAK,GAAG;AAE3F,MAAM,gBAAgB,CAAC,QAA4C,aAAa,KAAK,GAAG;AAExF,MAAM,eAAe,CAAC,QAA4C,aAAa,KAAK,GAAG;AAEvF,MAAM,eAAe,CAAC,QAA4C,aAAa,KAAK,GAAG;AAEvF,MAAM,0BAA0B,CAAC,QAA4C,aAAa,KAAK,GAAG;AAElG,MAAM,iBAAiB,CAAC,QAA4C,aAAa,KAAK,GAAG;AAEzF,MAAM,kBAAkB,CAAC,KAAe,eAC7C,oBAAgB,GAAG,EAChB,UAAU,OAAK,EAAE,QAAQ,IAAI,gCAAgC,EAC7D;AAAA,EACC,OAAK,EAAE,OAAO,OAAO;AAAA,EACrB,OAAK,sDAAsD,EAAE,OAAO,EAAE;AACxE,EACC,UAAU,OAAK,GAAG,MAAM,MAAM,OAAO,kCAAkC,EACvE;AAAA,EACC,QAAM,GAAG,MAAM,MAAM,aAAa,MAAM;AAAA,EACxC,OAAK,kCAAkC,MAAM,uBAAuB,GAAG,MAAM,MAAM,aAAa,CAAC;AACnG,EACC,KAAK,wCAAwC,MAAM,QAAQ;AAEhE,OAAO,OAAO;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":[]}
|
package/dist/matchers/Match.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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 Match_exports = {};
|
|
20
|
-
__export(Match_exports, {
|
|
21
|
-
Match: () => Match,
|
|
22
|
-
match: () => match
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(Match_exports);
|
|
25
|
-
var import_Utils = require("../utils/Utils");
|
|
26
|
-
var import_Types = require("../utils/Types");
|
|
27
|
-
class Match {
|
|
28
|
-
constructor(subject, failed = false, message = "") {
|
|
29
|
-
this.subject = subject;
|
|
30
|
-
this.failed = failed;
|
|
31
|
-
this.message = message;
|
|
32
|
-
}
|
|
33
|
-
not(p, message) {
|
|
34
|
-
if (this.failed) {
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
return new Match(this.subject, !p(this.subject), (0, import_Types.toMessage)(message, this.subject));
|
|
39
|
-
} catch (e) {
|
|
40
|
-
return new Match(this.subject, true, e.message);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
undefined(p, message) {
|
|
44
|
-
return this.not(() => (0, import_Utils.isDefined)(p(this.subject)), message);
|
|
45
|
-
}
|
|
46
|
-
else(message) {
|
|
47
|
-
return {
|
|
48
|
-
pass: !this.failed,
|
|
49
|
-
message: () => this.failed ? (0, import_Types.toMessage)(this.message) : `${(0, import_Types.toMessage)(message, this.subject)}, which we did not expect.`
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const match = (subject) => new Match(subject);
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
Match,
|
|
57
|
-
match
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=Match.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/matchers/Match.ts"],"sourcesContent":["import { isDefined } from '../utils/Utils';\nimport { Message, toMessage } from '../utils/Types';\n\nexport class Match<S> {\n constructor(private readonly subject: S, private readonly failed = false, private readonly message: Message<S> = '') {}\n\n not(p: (s: S) => boolean, message: Message<S>): Match<S> {\n if (this.failed) {\n return this;\n }\n try {\n return new Match<S>(this.subject, !p(this.subject), toMessage(message, this.subject));\n } catch (e: any) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return new Match<S>(this.subject, true, e.message);\n }\n }\n\n undefined(p: (s: S) => any, message: Message<S>): Match<S> {\n return this.not(() => isDefined(p(this.subject)), message);\n }\n\n else(message: Message<S>): jest.CustomMatcherResult {\n return {\n pass: !this.failed,\n message: () => (this.failed ? toMessage(this.message) : `${toMessage(message, this.subject)}, which we did not expect.`),\n };\n }\n}\n\nexport const match = <S>(subject: S): Match<S> => new Match<S>(subject);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAC1B,mBAAmC;AAE5B,MAAM,MAAS;AAAA,EACpB,YAA6B,SAA6B,SAAS,OAAwB,UAAsB,IAAI;AAAxF;AAA6B;AAAiC;AAAA,EAA2B;AAAA,EAEtH,IAAI,GAAsB,SAA+B;AACvD,QAAI,KAAK,QAAQ;AACf,aAAO;AAAA,IACT;AACA,QAAI;AACF,aAAO,IAAI,MAAS,KAAK,SAAS,CAAC,EAAE,KAAK,OAAO,OAAG,wBAAU,SAAS,KAAK,OAAO,CAAC;AAAA,IACtF,SAAS,GAAQ;AAEf,aAAO,IAAI,MAAS,KAAK,SAAS,MAAM,EAAE,OAAO;AAAA,IACnD;AAAA,EACF;AAAA,EAEA,UAAU,GAAkB,SAA+B;AACzD,WAAO,KAAK,IAAI,UAAM,wBAAU,EAAE,KAAK,OAAO,CAAC,GAAG,OAAO;AAAA,EAC3D;AAAA,EAEA,KAAK,SAA+C;AAClD,WAAO;AAAA,MACL,MAAM,CAAC,KAAK;AAAA,MACZ,SAAS,MAAO,KAAK,aAAS,wBAAU,KAAK,OAAO,IAAI,OAAG,wBAAU,SAAS,KAAK,OAAO,CAAC;AAAA,IAC7F;AAAA,EACF;AACF;AAEO,MAAM,QAAQ,CAAI,YAAyB,IAAI,MAAS,OAAO;","names":[]}
|
|
@@ -1,51 +0,0 @@
|
|
|
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 ResultMatchers_exports = {};
|
|
20
|
-
__export(ResultMatchers_exports, {
|
|
21
|
-
toFail: () => toFail,
|
|
22
|
-
toFailWith: () => toFailWith,
|
|
23
|
-
toResultWith: () => toResultWith
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(ResultMatchers_exports);
|
|
26
|
-
var import_Match = require("./Match");
|
|
27
|
-
const notDefined = "Results is not defined.";
|
|
28
|
-
const doesNotFail = "Results does not fail.";
|
|
29
|
-
const hasMessage = (res, message) => res.results.some((r) => r.message === message);
|
|
30
|
-
const messages = (res) => "'" + res?.results.map((r) => r.message).join("', '") + "'";
|
|
31
|
-
const toResultWith = (results, message) => (0, import_Match.match)(results).undefined((r) => r, notDefined).not(
|
|
32
|
-
(r) => hasMessage(r, message),
|
|
33
|
-
(r) => `Results does not have message '${message}', but it has messages ${messages(r)} instead.`
|
|
34
|
-
).else(`Succeeds with message ${message}`);
|
|
35
|
-
const toFail = (results) => (0, import_Match.match)(results).undefined((r) => r, notDefined).not((r) => !r.isValid, doesNotFail).else("Results does not fail");
|
|
36
|
-
const toFailWith = (results, message) => (0, import_Match.match)(results).undefined((r) => r, notDefined).not((r) => !r.isValid, doesNotFail).not(
|
|
37
|
-
(r) => hasMessage(r, message),
|
|
38
|
-
(r) => `Fails, but results does not have message '${message}', but it has messages ${messages(r)} instead.`
|
|
39
|
-
).else(`Fails with message '${message}'`);
|
|
40
|
-
expect.extend({
|
|
41
|
-
toResultWith,
|
|
42
|
-
toFail,
|
|
43
|
-
toFailWith
|
|
44
|
-
});
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
toFail,
|
|
48
|
-
toFailWith,
|
|
49
|
-
toResultWith
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=ResultMatchers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/matchers/ResultMatchers.ts"],"sourcesContent":["import { match } from './Match';\nimport { Results } from '../utils/Types';\n\n// Tests for handling Results.\n\nconst notDefined = 'Results is not defined.';\nconst doesNotFail = 'Results does not fail.';\n\nconst hasMessage = (res: Results, message: string) => res.results.some((r: any) => r.message === message);\n\nconst messages = (res: Results): string => \"'\" + res?.results.map(r => r.message).join(\"', '\") + \"'\";\n\nexport const toResultWith = (results: Results, message: string): jest.CustomMatcherResult =>\n match(results)\n .undefined(r => r, notDefined)\n .not(\n r => hasMessage(r, message),\n r => `Results does not have message '${message}', but it has messages ${messages(r)} instead.`\n )\n .else(`Succeeds with message ${message}`);\n\nexport const toFail = (results: Results): jest.CustomMatcherResult =>\n match(results)\n .undefined(r => r, notDefined)\n .not(r => !r.isValid, doesNotFail)\n .else('Results does not fail');\n\nexport const toFailWith = (results: Results, message: string): jest.CustomMatcherResult =>\n match(results)\n .undefined(r => r, notDefined)\n .not(r => !r.isValid, doesNotFail)\n .not(\n r => hasMessage(r, message),\n r => `Fails, but results does not have message '${message}', but it has messages ${messages(r)} instead.`\n )\n .else(`Fails with message '${message}'`);\n\nexpect.extend({\n toResultWith,\n toFail: toFail,\n toFailWith: toFailWith,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toResultWith(message: string): R;\n toFail(): R;\n toFailWith(message: string): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAKtB,MAAM,aAAa;AACnB,MAAM,cAAc;AAEpB,MAAM,aAAa,CAAC,KAAc,YAAoB,IAAI,QAAQ,KAAK,CAAC,MAAW,EAAE,YAAY,OAAO;AAExG,MAAM,WAAW,CAAC,QAAyB,MAAM,KAAK,QAAQ,IAAI,OAAK,EAAE,OAAO,EAAE,KAAK,MAAM,IAAI;AAE1F,MAAM,eAAe,CAAC,SAAkB,gBAC7C,oBAAM,OAAO,EACV,UAAU,OAAK,GAAG,UAAU,EAC5B;AAAA,EACC,OAAK,WAAW,GAAG,OAAO;AAAA,EAC1B,OAAK,kCAAkC,OAAO,0BAA0B,SAAS,CAAC,CAAC;AACrF,EACC,KAAK,yBAAyB,OAAO,EAAE;AAErC,MAAM,SAAS,CAAC,gBACrB,oBAAM,OAAO,EACV,UAAU,OAAK,GAAG,UAAU,EAC5B,IAAI,OAAK,CAAC,EAAE,SAAS,WAAW,EAChC,KAAK,uBAAuB;AAE1B,MAAM,aAAa,CAAC,SAAkB,gBAC3C,oBAAM,OAAO,EACV,UAAU,OAAK,GAAG,UAAU,EAC5B,IAAI,OAAK,CAAC,EAAE,SAAS,WAAW,EAChC;AAAA,EACC,OAAK,WAAW,GAAG,OAAO;AAAA,EAC1B,OAAK,6CAA6C,OAAO,0BAA0B,SAAS,CAAC,CAAC;AAChG,EACC,KAAK,uBAAuB,OAAO,GAAG;AAE3C,OAAO,OAAO;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":[]}
|
package/dist/matchers/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var matchers_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(matchers_exports);
|
|
18
|
-
__reExport(matchers_exports, require("./HttpMatchers"), module.exports);
|
|
19
|
-
__reExport(matchers_exports, require("./Match"), module.exports);
|
|
20
|
-
__reExport(matchers_exports, require("./Check"), module.exports);
|
|
21
|
-
__reExport(matchers_exports, require("./ResultMatchers"), module.exports);
|
|
22
|
-
__reExport(matchers_exports, require("./toBeArrayOf"), module.exports);
|
|
23
|
-
__reExport(matchers_exports, require("./toBeArrayOfWithLength"), module.exports);
|
|
24
|
-
__reExport(matchers_exports, require("./toBeAt"), module.exports);
|
|
25
|
-
__reExport(matchers_exports, require("./toBeExactlyAt"), module.exports);
|
|
26
|
-
__reExport(matchers_exports, require("./toFailMatcher"), module.exports);
|
|
27
|
-
__reExport(matchers_exports, require("./toBeValid"), module.exports);
|
|
28
|
-
__reExport(matchers_exports, require("./toMatchArray"), module.exports);
|
|
29
|
-
__reExport(matchers_exports, require("./toMatchExactJson"), module.exports);
|
|
30
|
-
__reExport(matchers_exports, require("./toMatchException"), module.exports);
|
|
31
|
-
__reExport(matchers_exports, require("./toMatchJson"), module.exports);
|
|
32
|
-
__reExport(matchers_exports, require("./toMatchRoute"), module.exports);
|
|
33
|
-
__reExport(matchers_exports, require("./toMatchText"), module.exports);
|
|
34
|
-
__reExport(matchers_exports, require("./toPassMatcher"), module.exports);
|
|
35
|
-
__reExport(matchers_exports, require("./toBeQueriedWith"), module.exports);
|
|
36
|
-
__reExport(matchers_exports, require("./toBeRoutedTo"), module.exports);
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
...require("./HttpMatchers"),
|
|
40
|
-
...require("./Match"),
|
|
41
|
-
...require("./Check"),
|
|
42
|
-
...require("./ResultMatchers"),
|
|
43
|
-
...require("./toBeArrayOf"),
|
|
44
|
-
...require("./toBeArrayOfWithLength"),
|
|
45
|
-
...require("./toBeAt"),
|
|
46
|
-
...require("./toBeExactlyAt"),
|
|
47
|
-
...require("./toFailMatcher"),
|
|
48
|
-
...require("./toBeValid"),
|
|
49
|
-
...require("./toMatchArray"),
|
|
50
|
-
...require("./toMatchExactJson"),
|
|
51
|
-
...require("./toMatchException"),
|
|
52
|
-
...require("./toMatchJson"),
|
|
53
|
-
...require("./toMatchRoute"),
|
|
54
|
-
...require("./toMatchText"),
|
|
55
|
-
...require("./toPassMatcher"),
|
|
56
|
-
...require("./toBeQueriedWith"),
|
|
57
|
-
...require("./toBeRoutedTo")
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/matchers/index.ts"],"sourcesContent":["export * from './HttpMatchers';\nexport * from './Match';\nexport * from './Check';\nexport * from './ResultMatchers';\nexport * from './toBeArrayOf';\nexport * from './toBeArrayOfWithLength';\nexport * from './toBeAt';\nexport * from './toBeExactlyAt';\nexport * from './toFailMatcher';\nexport * from './toBeValid';\nexport * from './toMatchArray';\nexport * from './toMatchExactJson';\nexport * from './toMatchException';\nexport * from './toMatchJson';\nexport * from './toMatchRoute';\nexport * from './toMatchText';\nexport * from './toPassMatcher';\nexport * from './toBeQueriedWith';\nexport * from './toBeRoutedTo';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,2BAAd;AACA,6BAAc,oBADd;AAEA,6BAAc,oBAFd;AAGA,6BAAc,6BAHd;AAIA,6BAAc,0BAJd;AAKA,6BAAc,oCALd;AAMA,6BAAc,qBANd;AAOA,6BAAc,4BAPd;AAQA,6BAAc,4BARd;AASA,6BAAc,wBATd;AAUA,6BAAc,2BAVd;AAWA,6BAAc,+BAXd;AAYA,6BAAc,+BAZd;AAaA,6BAAc,0BAbd;AAcA,6BAAc,2BAdd;AAeA,6BAAc,0BAfd;AAgBA,6BAAc,4BAhBd;AAiBA,6BAAc,8BAjBd;AAkBA,6BAAc,2BAlBd;","names":[]}
|
|
@@ -1,33 +0,0 @@
|
|
|
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 toBeArrayOf_exports = {};
|
|
20
|
-
__export(toBeArrayOf_exports, {
|
|
21
|
-
toBeArrayOf: () => toBeArrayOf
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(toBeArrayOf_exports);
|
|
24
|
-
var import_Match = require("./Match");
|
|
25
|
-
const toBeArrayOf = (items, ctor) => (0, import_Match.match)(items).undefined((it) => it, "Subject is undefined.").not((it) => it instanceof Array, "Subject is not an array.").not((it) => it.every((i) => i instanceof ctor), `Not all elements are of type '${ctor.name}'.`).else(`All elements in array are of type '${ctor.name}'`);
|
|
26
|
-
expect.extend({
|
|
27
|
-
toBeArrayOf
|
|
28
|
-
});
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
toBeArrayOf
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=toBeArrayOf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/matchers/toBeArrayOf.ts"],"sourcesContent":["import { Constructor as Ctor } from '../utils/Types';\nimport { match } from './Match';\n\nexport const toBeArrayOf = <T>(items: unknown, ctor: Ctor<T>): 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(it => (it as []).every((i: any) => i instanceof ctor), `Not all elements are of type '${ctor.name}'.`)\n .else(`All elements in array are of type '${ctor.name}'`);\n\nexpect.extend({\n toBeArrayOf,\n});\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace jest {\n interface Matchers<R, T> {\n toBeArrayOf<Z>(ctor: Ctor<Z>): R;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAsB;AAEf,MAAM,cAAc,CAAI,OAAgB,aAC7C,oBAAe,KAAK,EACjB,UAAU,QAAM,IAAI,uBAAuB,EAC3C,IAAI,QAAM,cAAc,OAAO,0BAA0B,EACzD,IAAI,QAAO,GAAU,MAAM,CAAC,MAAW,aAAa,IAAI,GAAG,iCAAiC,KAAK,IAAI,IAAI,EACzG,KAAK,sCAAsC,KAAK,IAAI,GAAG;AAE5D,OAAO,OAAO;AAAA,EACZ;AACF,CAAC;","names":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
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 toBeArrayOfWithLength_exports = {};
|
|
20
|
-
__export(toBeArrayOfWithLength_exports, {
|
|
21
|
-
toBeArrayOfWithLength: () => toBeArrayOfWithLength
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(toBeArrayOfWithLength_exports);
|
|
24
|
-
var import_Match = require("./Match");
|
|
25
|
-
const toBeArrayOfWithLength = (items, ctor, length) => (0, import_Match.match)(items).undefined((it) => it, "Subject is undefined.").not((it) => it instanceof Array, "Subject is not an array.").not(
|
|
26
|
-
(it) => it.length === length,
|
|
27
|
-
(it) => `Subject does not have ${length} elements, but ${it.length}.`
|
|
28
|
-
).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}'`);
|
|
29
|
-
expect.extend({
|
|
30
|
-
toBeArrayOfWithLength
|
|
31
|
-
});
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
toBeArrayOfWithLength
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=toBeArrayOfWithLength.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAsB;AAEf,MAAM,wBAAwB,CAAI,OAAgB,MAAe,eACtE,oBAAe,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":[]}
|
package/dist/matchers/toBeAt.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
toMatchAsString: () => toMatchAsString,
|
|
23
|
-
weExpectedButReceivedInstead: () => weExpectedButReceivedInstead
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(toBeRoutedTo_exports);
|
|
26
|
-
var import_Check = require("./Check");
|
|
27
|
-
var import_Utils = require("../utils/Utils");
|
|
28
|
-
var import_Match = require("./Match");
|
|
29
|
-
const weExpectedButReceivedInstead = ([r, e]) => `We expected ${(0, import_Utils.asString)(e)}, but we received '${(0, import_Utils.asString)(r)}' instead.`;
|
|
30
|
-
function toMatchAsString(received, expected) {
|
|
31
|
-
return (0, import_Check.checkDefined)(this, received, expected).not(
|
|
32
|
-
([r, e]) => this.equals((0, import_Utils.asString)(r), (0, import_Utils.asString)(e)),
|
|
33
|
-
([r, e]) => weExpectedButReceivedInstead([r, e])
|
|
34
|
-
).else();
|
|
35
|
-
}
|
|
36
|
-
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(
|
|
37
|
-
(c) => (0, import_Utils.asString)(c[0][0]) === (0, import_Utils.asString)(expected),
|
|
38
|
-
(c) => `We expected uri '${(0, import_Utils.asString)(expected)}', but we received uri '${(0, import_Utils.asString)(c[0][0])}' instead.`
|
|
39
|
-
).else(`Called uri does match '${(0, import_Utils.asString)(expected)}'`);
|
|
40
|
-
expect.extend({
|
|
41
|
-
toBeRoutedTo
|
|
42
|
-
});
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
toBeRoutedTo,
|
|
46
|
-
toMatchAsString,
|
|
47
|
-
weExpectedButReceivedInstead
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=toBeRoutedTo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/matchers/toBeRoutedTo.ts"],"sourcesContent":["import { checkDefined } from './Check';\nimport { Uri } from '../utils/Types';\nimport { asString } from '../utils/Utils';\nimport { match } from './Match';\n\nexport const weExpectedButReceivedInstead = ([r, e]: [any, any]) => `We expected ${asString(e)}, but we received '${asString(r)}' instead.`;\n\nexport function toMatchAsString(this: jest.MatcherContext, received: unknown, expected: unknown): jest.CustomMatcherResult {\n return checkDefined(this, received, expected)\n .not(\n ([r, e]) => this.equals(asString(r), asString(e)),\n ([r, e]) => weExpectedButReceivedInstead([r, e])\n )\n .else();\n}\n\n// export function toBeRoutedTo(this: jest.MatcherContext, query: jest.Mock, expected: Uri): jest.CustomMatcherResult {\n// return check<any[]>(this, query?.mock?.calls)\n// .undefined(r => r, \"Uri is unknown.\")\n// .not(r => r.length === 1, \"Method was not called.\")\n// .not(r => this.equals(asString(r[0][0]), asString(expected)), ([r,e]) => weExpectedButReceivedInstead([r[0][0], e]))\n// .else();\n// }\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;AAAA;AAAA,mBAA6B;AAE7B,mBAAyB;AACzB,mBAAsB;AAEf,MAAM,+BAA+B,CAAC,CAAC,GAAG,CAAC,MAAkB,mBAAe,uBAAS,CAAC,CAAC,0BAAsB,uBAAS,CAAC,CAAC;AAExH,SAAS,gBAA2C,UAAmB,UAA6C;AACzH,aAAO,2BAAa,MAAM,UAAU,QAAQ,EACzC;AAAA,IACC,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,WAAO,uBAAS,CAAC,OAAG,uBAAS,CAAC,CAAC;AAAA,IAChD,CAAC,CAAC,GAAG,CAAC,MAAM,6BAA6B,CAAC,GAAG,CAAC,CAAC;AAAA,EACjD,EACC,KAAK;AACV;AAUO,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":[]}
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|