bupkis 0.7.2 → 0.9.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/CHANGELOG.md +15 -0
- package/README.md +19 -2
- package/dist/commonjs/assertion/assertion-async.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-async.js +37 -7
- package/dist/commonjs/assertion/assertion-async.js.map +1 -1
- package/dist/commonjs/assertion/assertion-sync.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-sync.js +32 -8
- package/dist/commonjs/assertion/assertion-sync.js.map +1 -1
- package/dist/commonjs/assertion/assertion-types.d.ts +37 -31
- package/dist/commonjs/assertion/assertion-types.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-types.js +0 -32
- package/dist/commonjs/assertion/assertion-types.js.map +1 -1
- package/dist/commonjs/assertion/assertion.d.ts +3 -21
- package/dist/commonjs/assertion/assertion.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion.js +42 -27
- package/dist/commonjs/assertion/assertion.js.map +1 -1
- package/dist/commonjs/assertion/create.d.ts +2 -0
- package/dist/commonjs/assertion/create.d.ts.map +1 -1
- package/dist/commonjs/assertion/create.js +38 -42
- package/dist/commonjs/assertion/create.js.map +1 -1
- package/dist/commonjs/assertion/impl/assertion-util.d.ts +16 -4
- package/dist/commonjs/assertion/impl/assertion-util.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/assertion-util.js +20 -15
- package/dist/commonjs/assertion/impl/assertion-util.js.map +1 -1
- package/dist/commonjs/assertion/impl/async-parametric.d.ts +63 -11
- package/dist/commonjs/assertion/impl/async-parametric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/async-parametric.js +89 -52
- package/dist/commonjs/assertion/impl/async-parametric.js.map +1 -1
- package/dist/commonjs/assertion/impl/async.d.ts +116 -12
- package/dist/commonjs/assertion/impl/async.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/async.js +1 -1
- package/dist/commonjs/assertion/impl/sync-basic.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-basic.js +6 -4
- package/dist/commonjs/assertion/impl/sync-basic.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-collection.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-collection.js +24 -14
- package/dist/commonjs/assertion/impl/sync-collection.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-esoteric.d.ts +1 -5
- package/dist/commonjs/assertion/impl/sync-esoteric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-esoteric.js +11 -13
- package/dist/commonjs/assertion/impl/sync-esoteric.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts +27 -7
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.js +75 -51
- package/dist/commonjs/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync.d.ts +54 -22
- package/dist/commonjs/assertion/impl/sync.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync.js +1 -1
- package/dist/commonjs/assertion/impl/sync.js.map +1 -1
- package/dist/commonjs/assertion/index.d.ts +1 -1
- package/dist/commonjs/assertion/index.d.ts.map +1 -1
- package/dist/commonjs/assertion/index.js +0 -1
- package/dist/commonjs/assertion/index.js.map +1 -1
- package/dist/commonjs/assertion/slotify.d.ts +1 -13
- package/dist/commonjs/assertion/slotify.d.ts.map +1 -1
- package/dist/commonjs/assertion/slotify.js +49 -16
- package/dist/commonjs/assertion/slotify.js.map +1 -1
- package/dist/commonjs/bootstrap.d.ts +85 -17
- package/dist/commonjs/bootstrap.d.ts.map +1 -1
- package/dist/commonjs/bootstrap.js +1 -0
- package/dist/commonjs/bootstrap.js.map +1 -1
- package/dist/commonjs/diff.d.ts +51 -0
- package/dist/commonjs/diff.d.ts.map +1 -0
- package/dist/commonjs/diff.js +279 -0
- package/dist/commonjs/diff.js.map +1 -0
- package/dist/commonjs/error.d.ts +37 -18
- package/dist/commonjs/error.d.ts.map +1 -1
- package/dist/commonjs/error.js +44 -30
- package/dist/commonjs/error.js.map +1 -1
- package/dist/commonjs/expect.d.ts.map +1 -1
- package/dist/commonjs/expect.js +131 -78
- package/dist/commonjs/expect.js.map +1 -1
- package/dist/commonjs/guards.d.ts +24 -10
- package/dist/commonjs/guards.d.ts.map +1 -1
- package/dist/commonjs/guards.js +56 -39
- package/dist/commonjs/guards.js.map +1 -1
- package/dist/commonjs/index.d.ts +85 -17
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/internal-schema.d.ts +25 -0
- package/dist/commonjs/internal-schema.d.ts.map +1 -0
- package/dist/commonjs/internal-schema.js +209 -0
- package/dist/commonjs/internal-schema.js.map +1 -0
- package/dist/commonjs/schema.d.ts.map +1 -1
- package/dist/commonjs/schema.js +3 -2
- package/dist/commonjs/schema.js.map +1 -1
- package/dist/commonjs/use.js +22 -8
- package/dist/commonjs/use.js.map +1 -1
- package/dist/commonjs/util.d.ts +1 -0
- package/dist/commonjs/util.d.ts.map +1 -1
- package/dist/commonjs/util.js +14 -10
- package/dist/commonjs/util.js.map +1 -1
- package/dist/commonjs/value-to-schema.d.ts +1 -0
- package/dist/commonjs/value-to-schema.d.ts.map +1 -1
- package/dist/commonjs/value-to-schema.js +19 -12
- package/dist/commonjs/value-to-schema.js.map +1 -1
- package/dist/esm/assertion/assertion-async.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-async.js +37 -7
- package/dist/esm/assertion/assertion-async.js.map +1 -1
- package/dist/esm/assertion/assertion-sync.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-sync.js +32 -8
- package/dist/esm/assertion/assertion-sync.js.map +1 -1
- package/dist/esm/assertion/assertion-types.d.ts +37 -31
- package/dist/esm/assertion/assertion-types.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-types.js +1 -31
- package/dist/esm/assertion/assertion-types.js.map +1 -1
- package/dist/esm/assertion/assertion.d.ts +3 -21
- package/dist/esm/assertion/assertion.d.ts.map +1 -1
- package/dist/esm/assertion/assertion.js +42 -27
- package/dist/esm/assertion/assertion.js.map +1 -1
- package/dist/esm/assertion/create.d.ts +2 -0
- package/dist/esm/assertion/create.d.ts.map +1 -1
- package/dist/esm/assertion/create.js +37 -41
- package/dist/esm/assertion/create.js.map +1 -1
- package/dist/esm/assertion/impl/assertion-util.d.ts +16 -4
- package/dist/esm/assertion/impl/assertion-util.d.ts.map +1 -1
- package/dist/esm/assertion/impl/assertion-util.js +20 -15
- package/dist/esm/assertion/impl/assertion-util.js.map +1 -1
- package/dist/esm/assertion/impl/async-parametric.d.ts +63 -11
- package/dist/esm/assertion/impl/async-parametric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/async-parametric.js +89 -52
- package/dist/esm/assertion/impl/async-parametric.js.map +1 -1
- package/dist/esm/assertion/impl/async.d.ts +116 -12
- package/dist/esm/assertion/impl/async.d.ts.map +1 -1
- package/dist/esm/assertion/impl/async.js +2 -2
- package/dist/esm/assertion/impl/async.js.map +1 -1
- package/dist/esm/assertion/impl/sync-basic.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-basic.js +6 -4
- package/dist/esm/assertion/impl/sync-basic.js.map +1 -1
- package/dist/esm/assertion/impl/sync-collection.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-collection.js +24 -14
- package/dist/esm/assertion/impl/sync-collection.js.map +1 -1
- package/dist/esm/assertion/impl/sync-esoteric.d.ts +1 -5
- package/dist/esm/assertion/impl/sync-esoteric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-esoteric.js +11 -13
- package/dist/esm/assertion/impl/sync-esoteric.js.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.d.ts +27 -7
- package/dist/esm/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.js +75 -51
- package/dist/esm/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/esm/assertion/impl/sync.d.ts +54 -22
- package/dist/esm/assertion/impl/sync.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync.js +2 -2
- package/dist/esm/assertion/impl/sync.js.map +1 -1
- package/dist/esm/assertion/index.d.ts +1 -1
- package/dist/esm/assertion/index.d.ts.map +1 -1
- package/dist/esm/assertion/index.js +0 -1
- package/dist/esm/assertion/index.js.map +1 -1
- package/dist/esm/assertion/slotify.d.ts +1 -13
- package/dist/esm/assertion/slotify.d.ts.map +1 -1
- package/dist/esm/assertion/slotify.js +50 -17
- package/dist/esm/assertion/slotify.js.map +1 -1
- package/dist/esm/bootstrap.d.ts +85 -17
- package/dist/esm/bootstrap.d.ts.map +1 -1
- package/dist/esm/bootstrap.js +1 -0
- package/dist/esm/bootstrap.js.map +1 -1
- package/dist/esm/diff.d.ts +51 -0
- package/dist/esm/diff.d.ts.map +1 -0
- package/dist/esm/diff.js +273 -0
- package/dist/esm/diff.js.map +1 -0
- package/dist/esm/error.d.ts +37 -18
- package/dist/esm/error.d.ts.map +1 -1
- package/dist/esm/error.js +41 -27
- package/dist/esm/error.js.map +1 -1
- package/dist/esm/expect.d.ts.map +1 -1
- package/dist/esm/expect.js +133 -80
- package/dist/esm/expect.js.map +1 -1
- package/dist/esm/guards.d.ts +24 -10
- package/dist/esm/guards.d.ts.map +1 -1
- package/dist/esm/guards.js +52 -36
- package/dist/esm/guards.js.map +1 -1
- package/dist/esm/index.d.ts +85 -17
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/internal-schema.d.ts +25 -0
- package/dist/esm/internal-schema.d.ts.map +1 -0
- package/dist/esm/internal-schema.js +203 -0
- package/dist/esm/internal-schema.js.map +1 -0
- package/dist/esm/schema.d.ts.map +1 -1
- package/dist/esm/schema.js +3 -2
- package/dist/esm/schema.js.map +1 -1
- package/dist/esm/use.js +19 -6
- package/dist/esm/use.js.map +1 -1
- package/dist/esm/util.d.ts +1 -0
- package/dist/esm/util.d.ts.map +1 -1
- package/dist/esm/util.js +14 -10
- package/dist/esm/util.js.map +1 -1
- package/dist/esm/value-to-schema.d.ts +1 -0
- package/dist/esm/value-to-schema.d.ts.map +1 -1
- package/dist/esm/value-to-schema.js +20 -13
- package/dist/esm/value-to-schema.js.map +1 -1
- package/package.json +29 -11
- package/src/assertion/assertion-async.ts +42 -14
- package/src/assertion/assertion-sync.ts +40 -17
- package/src/assertion/assertion-types.ts +55 -45
- package/src/assertion/assertion.ts +49 -32
- package/src/assertion/create.ts +46 -65
- package/src/assertion/impl/assertion-util.ts +31 -18
- package/src/assertion/impl/async-parametric.ts +93 -52
- package/src/assertion/impl/async.ts +2 -2
- package/src/assertion/impl/sync-basic.ts +7 -4
- package/src/assertion/impl/sync-collection.ts +34 -14
- package/src/assertion/impl/sync-esoteric.ts +17 -13
- package/src/assertion/impl/sync-parametric.ts +79 -52
- package/src/assertion/impl/sync.ts +2 -2
- package/src/assertion/index.ts +1 -1
- package/src/assertion/slotify.ts +67 -21
- package/src/bootstrap.ts +1 -0
- package/src/diff.ts +343 -0
- package/src/error.ts +66 -31
- package/src/expect.ts +195 -129
- package/src/guards.ts +74 -48
- package/src/internal-schema.ts +246 -0
- package/src/schema.ts +4 -2
- package/src/use.ts +21 -7
- package/src/util.ts +15 -12
- package/src/value-to-schema.ts +21 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAS3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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AC,GAAG,CAC3B,SAAS,EACT,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,CACxC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;SAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,IAAI,4BAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,QAAQ,EAAE,CAAC;YACb,yBAAyB,CAAC,GAAG,CAC3B,SAAS,EACT,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,CACxC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,qEAAqE;IACrE,oBAAoB;IACpB,MAAM,IAAI,4BAA4B,CACpC,+EAA+E,CAChF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4,21 +4,33 @@
|
|
|
4
4
|
* @internal
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Executes & traps a `Promise` rejected from an async function, capturing the
|
|
9
|
+
* error.
|
|
10
|
+
*
|
|
11
|
+
* @function
|
|
12
|
+
* @param fn The function to execute that may throw an error or return a
|
|
13
|
+
* `Promise`
|
|
14
|
+
* @returns Rejection or whatever was fulfilled
|
|
15
|
+
*/
|
|
16
|
+
export declare const trapAsyncFnError: (fn: () => unknown) => Promise<TrapResult>;
|
|
7
17
|
/**
|
|
8
18
|
* Awaits & traps a Promise, capturing any rejection error.
|
|
9
19
|
*
|
|
20
|
+
* @function
|
|
10
21
|
* @param promise The `Promise` to trap
|
|
11
|
-
* @returns
|
|
22
|
+
* @returns Result object
|
|
12
23
|
*/
|
|
13
|
-
export declare const trapPromiseError: (promise: PromiseLike<unknown>) => Promise<
|
|
24
|
+
export declare const trapPromiseError: (promise: PromiseLike<unknown>) => Promise<TrapResult>;
|
|
14
25
|
/**
|
|
15
26
|
* Executes & traps a synchronous function that may throw, capturing any thrown
|
|
16
27
|
* error and discarding the result.
|
|
17
28
|
*
|
|
18
29
|
* @remarks
|
|
19
30
|
* Avoids throwing `undefined` for some reason.
|
|
31
|
+
* @function
|
|
20
32
|
* @param fn Function to execute
|
|
21
|
-
* @returns
|
|
33
|
+
* @returns Result object
|
|
22
34
|
*/
|
|
23
|
-
export declare const trapError: (fn: () => unknown) =>
|
|
35
|
+
export declare const trapError: (fn: () => unknown) => TrapResult;
|
|
24
36
|
//# sourceMappingURL=assertion-util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-util.d.ts","sourceRoot":"","sources":["../../../../src/assertion/impl/assertion-util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"assertion-util.d.ts","sourceRoot":"","sources":["../../../../src/assertion/impl/assertion-util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,OAAO,KAChB,OAAO,CAAC,UAAU,CASpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,WAAW,CAAC,OAAO,CAAC,KAC5B,OAAO,CAAC,UAAU,CAOpB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GAAI,IAAI,MAAM,OAAO,KAAG,UAO7C,CAAC"}
|
|
@@ -8,30 +8,36 @@
|
|
|
8
8
|
* Executes & traps a `Promise` rejected from an async function, capturing the
|
|
9
9
|
* error.
|
|
10
10
|
*
|
|
11
|
+
* @function
|
|
11
12
|
* @param fn The function to execute that may throw an error or return a
|
|
12
13
|
* `Promise`
|
|
13
|
-
* @returns Rejection
|
|
14
|
+
* @returns Rejection or whatever was fulfilled
|
|
14
15
|
*/
|
|
15
16
|
export const trapAsyncFnError = async (fn) => {
|
|
16
17
|
try {
|
|
17
|
-
await fn();
|
|
18
|
+
const result = await fn();
|
|
19
|
+
return { result };
|
|
18
20
|
}
|
|
19
|
-
catch (
|
|
20
|
-
return
|
|
21
|
+
catch (error) {
|
|
22
|
+
return {
|
|
23
|
+
error: error ?? new TypeError(`Function rejected with undefined: ${fn}`),
|
|
24
|
+
};
|
|
21
25
|
}
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
24
28
|
* Awaits & traps a Promise, capturing any rejection error.
|
|
25
29
|
*
|
|
30
|
+
* @function
|
|
26
31
|
* @param promise The `Promise` to trap
|
|
27
|
-
* @returns
|
|
32
|
+
* @returns Result object
|
|
28
33
|
*/
|
|
29
34
|
export const trapPromiseError = async (promise) => {
|
|
30
35
|
try {
|
|
31
|
-
await promise;
|
|
36
|
+
const result = await promise;
|
|
37
|
+
return { result };
|
|
32
38
|
}
|
|
33
|
-
catch (
|
|
34
|
-
return
|
|
39
|
+
catch (error) {
|
|
40
|
+
return { error: error ?? new TypeError('Promise rejected with undefined') };
|
|
35
41
|
}
|
|
36
42
|
};
|
|
37
43
|
/**
|
|
@@ -40,18 +46,17 @@ export const trapPromiseError = async (promise) => {
|
|
|
40
46
|
*
|
|
41
47
|
* @remarks
|
|
42
48
|
* Avoids throwing `undefined` for some reason.
|
|
49
|
+
* @function
|
|
43
50
|
* @param fn Function to execute
|
|
44
|
-
* @returns
|
|
51
|
+
* @returns Result object
|
|
45
52
|
*/
|
|
46
53
|
export const trapError = (fn) => {
|
|
47
54
|
try {
|
|
48
|
-
fn();
|
|
55
|
+
const result = fn();
|
|
56
|
+
return { result };
|
|
49
57
|
}
|
|
50
|
-
catch (
|
|
51
|
-
|
|
52
|
-
return new Error('Function threw undefined');
|
|
53
|
-
}
|
|
54
|
-
return err;
|
|
58
|
+
catch (error) {
|
|
59
|
+
return { error: error ?? new TypeError(`Function threw undefined: ${fn}`) };
|
|
55
60
|
}
|
|
56
61
|
};
|
|
57
62
|
//# sourceMappingURL=assertion-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-util.js","sourceRoot":"","sources":["../../../../src/assertion/impl/assertion-util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"assertion-util.js","sourceRoot":"","sources":["../../../../src/assertion/impl/assertion-util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,EAAiB,EACI,EAAE;IACvB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC;QAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,KAAK,EAAE,KAAK,IAAI,IAAI,SAAS,CAAC,qCAAqC,EAAE,EAAE,CAAC;SACzE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACnC,OAA6B,EACR,EAAE;IACvB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,IAAI,SAAS,CAAC,iCAAiC,CAAC,EAAE,CAAC;IAC9E,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAiB,EAAc,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,EAAE,EAAE,CAAC;QACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,IAAI,SAAS,CAAC,6BAA6B,EAAE,EAAE,CAAC,EAAE,CAAC;IAC9E,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -101,7 +101,17 @@ export declare const promiseRejectAssertion: import("../assertion-types.js").Ass
|
|
|
101
101
|
*
|
|
102
102
|
* @group Parametric Assertions (Async)
|
|
103
103
|
*/
|
|
104
|
-
export declare const functionRejectWithTypeAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with a", "to reject with an"], z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("../../types.js").Constructor) => Promise<
|
|
104
|
+
export declare const functionRejectWithTypeAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with a", "to reject with an"], z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, ctor: import("../../types.js").Constructor) => Promise<{
|
|
105
|
+
actual: string;
|
|
106
|
+
expect: string;
|
|
107
|
+
message: string;
|
|
108
|
+
expected?: never;
|
|
109
|
+
} | {
|
|
110
|
+
actual: string;
|
|
111
|
+
expected: string;
|
|
112
|
+
message: string;
|
|
113
|
+
expect?: never;
|
|
114
|
+
} | undefined>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with a", "to reject with an"]>, z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>]>;
|
|
105
115
|
/**
|
|
106
116
|
* Assertion for testing if a Promise rejects with a specific error type.
|
|
107
117
|
*
|
|
@@ -122,7 +132,17 @@ export declare const functionRejectWithTypeAssertion: import("../assertion-types
|
|
|
122
132
|
*
|
|
123
133
|
* @group Parametric Assertions (Async)
|
|
124
134
|
*/
|
|
125
|
-
export declare const promiseRejectWithTypeAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with a", "to reject with an"], z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>], (subject: PromiseLike<unknown>, ctor: import("../../types.js").Constructor) => Promise<
|
|
135
|
+
export declare const promiseRejectWithTypeAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with a", "to reject with an"], z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>], (subject: PromiseLike<unknown>, ctor: import("../../types.js").Constructor) => Promise<{
|
|
136
|
+
actual: string;
|
|
137
|
+
expect: string;
|
|
138
|
+
message: string;
|
|
139
|
+
expected?: never;
|
|
140
|
+
} | {
|
|
141
|
+
actual: string;
|
|
142
|
+
expected: string;
|
|
143
|
+
message: string;
|
|
144
|
+
expect?: never;
|
|
145
|
+
} | undefined>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with a", "to reject with an"]>, z.ZodCustom<import("../../types.js").Constructor, import("../../types.js").Constructor>]>;
|
|
126
146
|
/**
|
|
127
147
|
* Assertion for testing if a function rejects with an error satisfying specific
|
|
128
148
|
* criteria.
|
|
@@ -149,11 +169,19 @@ export declare const promiseRejectWithTypeAssertion: import("../assertion-types.
|
|
|
149
169
|
*
|
|
150
170
|
* @group Parametric Assertions (Async)
|
|
151
171
|
*/
|
|
152
|
-
export declare const functionRejectWithErrorSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with error satisfying"], z.ZodAny], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<
|
|
172
|
+
export declare const functionRejectWithErrorSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to reject with error satisfying"], z.ZodAny], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<{
|
|
153
173
|
actual: string;
|
|
154
174
|
expect: string;
|
|
155
175
|
message: string;
|
|
156
|
-
|
|
176
|
+
schema?: never;
|
|
177
|
+
subject?: never;
|
|
178
|
+
} | {
|
|
179
|
+
schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
180
|
+
subject: {} | null;
|
|
181
|
+
actual?: never;
|
|
182
|
+
expect?: never;
|
|
183
|
+
message?: never;
|
|
184
|
+
}>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with error satisfying"]>, z.ZodAny]>;
|
|
157
185
|
/**
|
|
158
186
|
* Assertion for testing if a Promise rejects with an error satisfying specific
|
|
159
187
|
* criteria.
|
|
@@ -180,11 +208,19 @@ export declare const functionRejectWithErrorSatisfyingAssertion: import("../asse
|
|
|
180
208
|
*
|
|
181
209
|
* @group Parametric Assertions (Async)
|
|
182
210
|
*/
|
|
183
|
-
export declare const promiseRejectWithErrorSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with error satisfying"], z.ZodAny], (subject: PromiseLike<unknown>, param: any) => Promise<
|
|
211
|
+
export declare const promiseRejectWithErrorSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to reject with error satisfying"], z.ZodAny], (subject: PromiseLike<unknown>, param: any) => Promise<{
|
|
184
212
|
actual: string;
|
|
185
213
|
expect: string;
|
|
186
214
|
message: string;
|
|
187
|
-
|
|
215
|
+
schema?: never;
|
|
216
|
+
subject?: never;
|
|
217
|
+
} | {
|
|
218
|
+
schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
219
|
+
subject: {} | null;
|
|
220
|
+
actual?: never;
|
|
221
|
+
expect?: never;
|
|
222
|
+
message?: never;
|
|
223
|
+
}>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to reject with error satisfying"]>, z.ZodAny]>;
|
|
188
224
|
/**
|
|
189
225
|
* Assertion for testing if a Promise fulfills with a value satisfying specific
|
|
190
226
|
* criteria.
|
|
@@ -211,11 +247,19 @@ export declare const promiseRejectWithErrorSatisfyingAssertion: import("../asser
|
|
|
211
247
|
*
|
|
212
248
|
* @group Parametric Assertions (Async)
|
|
213
249
|
*/
|
|
214
|
-
export declare const
|
|
215
|
-
actual:
|
|
250
|
+
export declare const promiseResolveWithValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (promise: PromiseLike<unknown>, param: any) => Promise<{
|
|
251
|
+
actual: string;
|
|
216
252
|
expect: string;
|
|
217
253
|
message: string;
|
|
218
|
-
|
|
254
|
+
schema?: never;
|
|
255
|
+
subject?: never;
|
|
256
|
+
} | {
|
|
257
|
+
schema: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
258
|
+
subject: unknown;
|
|
259
|
+
actual?: never;
|
|
260
|
+
expect?: never;
|
|
261
|
+
message?: never;
|
|
262
|
+
}>, readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve with value satisfying"]>, z.ZodAny]>;
|
|
219
263
|
/**
|
|
220
264
|
* Assertion for testing if a function returns a Promise that fulfills with a
|
|
221
265
|
* value satisfying specific criteria.
|
|
@@ -242,9 +286,17 @@ export declare const promiseFulfillWithValueSatisfyingAssertion: import("../asse
|
|
|
242
286
|
*
|
|
243
287
|
* @group Parametric Assertions (Async)
|
|
244
288
|
*/
|
|
245
|
-
export declare const functionFulfillWithValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<
|
|
289
|
+
export declare const functionFulfillWithValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<{
|
|
246
290
|
actual: string;
|
|
247
291
|
expect: string;
|
|
248
292
|
message: string;
|
|
249
|
-
|
|
293
|
+
schema?: never;
|
|
294
|
+
subject?: never;
|
|
295
|
+
} | {
|
|
296
|
+
schema: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
297
|
+
subject: unknown;
|
|
298
|
+
actual?: never;
|
|
299
|
+
expect?: never;
|
|
300
|
+
message?: never;
|
|
301
|
+
}>, readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, import("../assertion-types.js").PhraseLiteralChoiceSlot<readonly ["to fulfill with value satisfying", "to resolve with value satisfying"]>, z.ZodAny]>;
|
|
250
302
|
//# sourceMappingURL=async-parametric.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-parametric.d.ts","sourceRoot":"","sources":["../../../../src/assertion/impl/async-parametric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAgB3B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB;;;;iSAiBpC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;
|
|
1
|
+
{"version":3,"file":"async-parametric.d.ts","sourceRoot":"","sources":["../../../../src/assertion/impl/async-parametric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAgB3B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB;;;;iSAiBpC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;mLAiBnC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;;;;iQAYnC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;;;;mJAYlC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;uYA+B3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;yRA+B1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,0CAA0C;;;;;;;;;;;;sSA0CtD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;wLAyCrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,0CAA0C;;;;;;;;;;;;6NA2BtD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,2CAA2C;;;;;;;;;;;;2UA0BvD,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { inspect } from 'node:util';
|
|
16
16
|
import { z } from 'zod/v4';
|
|
17
|
-
import {
|
|
17
|
+
import { InvalidObjectSchemaError } from '../../error.js';
|
|
18
18
|
import { isA, isNonNullObject, isString } from '../../guards.js';
|
|
19
19
|
import { ConstructibleSchema, FunctionSchema, WrappedPromiseLikeSchema, } from '../../schema.js';
|
|
20
20
|
import { valueToSchema, valueToSchemaOptionsForSatisfies, } from '../../value-to-schema.js';
|
|
@@ -44,7 +44,7 @@ export const functionResolveAssertion = createAsyncAssertion([FunctionSchema, ['
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
}, {
|
|
47
|
-
anchor: 'to-resolve',
|
|
47
|
+
anchor: 'promise-to-resolve',
|
|
48
48
|
category: 'promise',
|
|
49
49
|
});
|
|
50
50
|
/**
|
|
@@ -70,6 +70,9 @@ export const promiseResolveAssertion = createAsyncAssertion([WrappedPromiseLikeS
|
|
|
70
70
|
message: 'Expected promise to fulfill, but it rejected instead',
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
+
}, {
|
|
74
|
+
anchor: 'promise-to-resolve',
|
|
75
|
+
category: 'promise',
|
|
73
76
|
});
|
|
74
77
|
/**
|
|
75
78
|
* Assertion for testing if a function returns a rejected Promise.
|
|
@@ -84,15 +87,14 @@ export const promiseResolveAssertion = createAsyncAssertion([WrappedPromiseLikeS
|
|
|
84
87
|
* @group Parametric Assertions (Async)
|
|
85
88
|
*/
|
|
86
89
|
export const functionRejectAssertion = createAsyncAssertion([FunctionSchema, 'to reject'], async (subject) => {
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
const { error, result } = await trapAsyncFnError(subject);
|
|
91
|
+
if (error === undefined) {
|
|
89
92
|
return {
|
|
90
93
|
actual: 'function fulfilled',
|
|
91
|
-
expected: 'function
|
|
92
|
-
message:
|
|
94
|
+
expected: 'function rejected',
|
|
95
|
+
message: `Expected function to reject, but it fulfilled with ${inspect(result)}`,
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
|
-
catch { }
|
|
96
98
|
});
|
|
97
99
|
/**
|
|
98
100
|
* Assertion for testing if a Promise is rejected.
|
|
@@ -107,15 +109,14 @@ export const functionRejectAssertion = createAsyncAssertion([FunctionSchema, 'to
|
|
|
107
109
|
* @group Parametric Assertions (Async)
|
|
108
110
|
*/
|
|
109
111
|
export const promiseRejectAssertion = createAsyncAssertion([WrappedPromiseLikeSchema, 'to reject'], async (subject) => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
const { error, result } = await trapPromiseError(subject);
|
|
113
|
+
if (error === undefined) {
|
|
112
114
|
return {
|
|
113
|
-
actual: '
|
|
114
|
-
expected: '
|
|
115
|
-
message:
|
|
115
|
+
actual: 'Promise fulfilled',
|
|
116
|
+
expected: 'Promise rejected',
|
|
117
|
+
message: `Expected Promise to reject, but it fulfilled with ${inspect(result)}`,
|
|
116
118
|
};
|
|
117
119
|
}
|
|
118
|
-
catch { }
|
|
119
120
|
});
|
|
120
121
|
/**
|
|
121
122
|
* Assertion for testing if a function rejects with a specific error type.
|
|
@@ -142,11 +143,29 @@ export const functionRejectWithTypeAssertion = createAsyncAssertion([
|
|
|
142
143
|
['to reject with a', 'to reject with an'],
|
|
143
144
|
ConstructibleSchema,
|
|
144
145
|
], async (subject, ctor) => {
|
|
145
|
-
const error = await trapAsyncFnError(subject);
|
|
146
|
-
if (
|
|
147
|
-
return
|
|
146
|
+
const { error, result } = await trapAsyncFnError(subject);
|
|
147
|
+
if (error === undefined) {
|
|
148
|
+
return {
|
|
149
|
+
actual: 'function fulfilled',
|
|
150
|
+
expect: 'function rejected',
|
|
151
|
+
message: `Expected function to reject, but it fulfilled with ${inspect(result)}`,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (!isA(error, ctor)) {
|
|
155
|
+
if (isNonNullObject(error)) {
|
|
156
|
+
const err = error;
|
|
157
|
+
return {
|
|
158
|
+
actual: err.constructor.name,
|
|
159
|
+
expected: ctor.name,
|
|
160
|
+
message: `Expected function to reject with an instance of ${ctor.name}, but it rejected with a ${err.constructor.name}`,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
actual: typeof error,
|
|
165
|
+
expected: ctor.name,
|
|
166
|
+
message: `Expected function to reject with an instance of ${ctor.name}, but it rejected with a value of type ${typeof error}: ${inspect(error)}`,
|
|
167
|
+
};
|
|
148
168
|
}
|
|
149
|
-
return isA(error, ctor);
|
|
150
169
|
});
|
|
151
170
|
/**
|
|
152
171
|
* Assertion for testing if a Promise rejects with a specific error type.
|
|
@@ -173,11 +192,29 @@ export const promiseRejectWithTypeAssertion = createAsyncAssertion([
|
|
|
173
192
|
['to reject with a', 'to reject with an'],
|
|
174
193
|
ConstructibleSchema,
|
|
175
194
|
], async (subject, ctor) => {
|
|
176
|
-
const error = await trapPromiseError(subject);
|
|
177
|
-
if (
|
|
178
|
-
return
|
|
195
|
+
const { error, result } = await trapPromiseError(subject);
|
|
196
|
+
if (error === undefined) {
|
|
197
|
+
return {
|
|
198
|
+
actual: 'Promise fulfilled',
|
|
199
|
+
expect: 'Promise rejected',
|
|
200
|
+
message: `Expected Promise to reject, but it fulfilled with ${inspect(result)}`,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
if (!isA(error, ctor)) {
|
|
204
|
+
if (isNonNullObject(error)) {
|
|
205
|
+
const err = error;
|
|
206
|
+
return {
|
|
207
|
+
actual: err.constructor.name,
|
|
208
|
+
expected: ctor.name,
|
|
209
|
+
message: `Expected Promise to reject with an instance of ${ctor.name}, but it rejected with a ${err.constructor.name}`,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
actual: typeof error,
|
|
214
|
+
expected: ctor.name,
|
|
215
|
+
message: `Expected Promise to reject with an instance of ${ctor.name}, but it rejected with a value of type ${typeof error}: ${inspect(error)}`,
|
|
216
|
+
};
|
|
179
217
|
}
|
|
180
|
-
return isA(error, ctor);
|
|
181
218
|
});
|
|
182
219
|
/**
|
|
183
220
|
* Assertion for testing if a function rejects with an error satisfying specific
|
|
@@ -206,12 +243,12 @@ export const promiseRejectWithTypeAssertion = createAsyncAssertion([
|
|
|
206
243
|
* @group Parametric Assertions (Async)
|
|
207
244
|
*/
|
|
208
245
|
export const functionRejectWithErrorSatisfyingAssertion = createAsyncAssertion([FunctionSchema, ['to reject with error satisfying'], z.any()], async (subject, param) => {
|
|
209
|
-
const error = await trapAsyncFnError(subject);
|
|
210
|
-
if (
|
|
246
|
+
const { error, result } = await trapAsyncFnError(subject);
|
|
247
|
+
if (error === undefined) {
|
|
211
248
|
return {
|
|
212
249
|
actual: 'function fulfilled',
|
|
213
250
|
expect: 'function to reject',
|
|
214
|
-
message:
|
|
251
|
+
message: `Expected function to reject, but it fulfilled with ${inspect(result)}`,
|
|
215
252
|
};
|
|
216
253
|
}
|
|
217
254
|
let schema;
|
|
@@ -235,12 +272,12 @@ export const functionRejectWithErrorSatisfyingAssertion = createAsyncAssertion([
|
|
|
235
272
|
}
|
|
236
273
|
/* c8 ignore next 5 */
|
|
237
274
|
if (!schema) {
|
|
238
|
-
throw new
|
|
239
|
-
}
|
|
240
|
-
const result = schema.safeParse(error);
|
|
241
|
-
if (!result.success) {
|
|
242
|
-
return result.error;
|
|
275
|
+
throw new InvalidObjectSchemaError(`Invalid parameter schema: ${inspect(param, { depth: 2 })}`, { schema: param });
|
|
243
276
|
}
|
|
277
|
+
return {
|
|
278
|
+
schema,
|
|
279
|
+
subject: error,
|
|
280
|
+
};
|
|
244
281
|
});
|
|
245
282
|
/**
|
|
246
283
|
* Assertion for testing if a Promise rejects with an error satisfying specific
|
|
@@ -269,12 +306,12 @@ export const functionRejectWithErrorSatisfyingAssertion = createAsyncAssertion([
|
|
|
269
306
|
* @group Parametric Assertions (Async)
|
|
270
307
|
*/
|
|
271
308
|
export const promiseRejectWithErrorSatisfyingAssertion = createAsyncAssertion([WrappedPromiseLikeSchema, ['to reject with error satisfying'], z.any()], async (subject, param) => {
|
|
272
|
-
const error = await trapPromiseError(subject);
|
|
273
|
-
if (
|
|
309
|
+
const { error, result } = await trapPromiseError(subject);
|
|
310
|
+
if (error === undefined) {
|
|
274
311
|
return {
|
|
275
|
-
actual: '
|
|
276
|
-
expect: '
|
|
277
|
-
message:
|
|
312
|
+
actual: 'Promise fulfilled',
|
|
313
|
+
expect: 'Promise rejected',
|
|
314
|
+
message: `Expected Promise to reject, but it fulfilled with ${inspect(result)}`,
|
|
278
315
|
};
|
|
279
316
|
}
|
|
280
317
|
let schema;
|
|
@@ -298,12 +335,12 @@ export const promiseRejectWithErrorSatisfyingAssertion = createAsyncAssertion([W
|
|
|
298
335
|
}
|
|
299
336
|
/* c8 ignore next 5 */
|
|
300
337
|
if (!schema) {
|
|
301
|
-
throw new
|
|
302
|
-
}
|
|
303
|
-
const result = schema.safeParse(error);
|
|
304
|
-
if (!result.success) {
|
|
305
|
-
return result.error;
|
|
338
|
+
throw new InvalidObjectSchemaError(`Invalid parameter schema: ${inspect(param, { depth: 2 })}`, { schema: param });
|
|
306
339
|
}
|
|
340
|
+
return {
|
|
341
|
+
schema,
|
|
342
|
+
subject: error,
|
|
343
|
+
};
|
|
307
344
|
});
|
|
308
345
|
/**
|
|
309
346
|
* Assertion for testing if a Promise fulfills with a value satisfying specific
|
|
@@ -331,7 +368,7 @@ export const promiseRejectWithErrorSatisfyingAssertion = createAsyncAssertion([W
|
|
|
331
368
|
*
|
|
332
369
|
* @group Parametric Assertions (Async)
|
|
333
370
|
*/
|
|
334
|
-
export const
|
|
371
|
+
export const promiseResolveWithValueSatisfyingAssertion = createAsyncAssertion([
|
|
335
372
|
WrappedPromiseLikeSchema,
|
|
336
373
|
['to fulfill with value satisfying', 'to resolve with value satisfying'],
|
|
337
374
|
z.any(),
|
|
@@ -342,16 +379,16 @@ export const promiseFulfillWithValueSatisfyingAssertion = createAsyncAssertion([
|
|
|
342
379
|
}
|
|
343
380
|
catch (err) {
|
|
344
381
|
return {
|
|
345
|
-
actual:
|
|
346
|
-
expect: '
|
|
347
|
-
message: `Expected
|
|
382
|
+
actual: 'Promise rejected',
|
|
383
|
+
expect: 'Promise to fulfill',
|
|
384
|
+
message: `Expected Promise to fulfill, but it rejected with ${inspect(err)}`,
|
|
348
385
|
};
|
|
349
386
|
}
|
|
350
387
|
const schema = valueToSchema(param, valueToSchemaOptionsForSatisfies);
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
388
|
+
return {
|
|
389
|
+
schema,
|
|
390
|
+
subject: value,
|
|
391
|
+
};
|
|
355
392
|
});
|
|
356
393
|
/**
|
|
357
394
|
* Assertion for testing if a function returns a Promise that fulfills with a
|
|
@@ -391,14 +428,14 @@ export const functionFulfillWithValueSatisfyingAssertion = createAsyncAssertion(
|
|
|
391
428
|
catch (err) {
|
|
392
429
|
return {
|
|
393
430
|
actual: 'function rejected',
|
|
394
|
-
expect: 'function
|
|
431
|
+
expect: 'function fulfilled',
|
|
395
432
|
message: `Expected function to fulfill, but it rejected with ${inspect(err)}`,
|
|
396
433
|
};
|
|
397
434
|
}
|
|
398
435
|
const schema = valueToSchema(param, valueToSchemaOptionsForSatisfies);
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
436
|
+
return {
|
|
437
|
+
schema,
|
|
438
|
+
subject: value,
|
|
439
|
+
};
|
|
403
440
|
});
|
|
404
441
|
//# sourceMappingURL=async-parametric.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-parametric.js","sourceRoot":"","sources":["../../../../src/assertion/impl/async-parametric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"async-parametric.js","sourceRoot":"","sources":["../../../../src/assertion/impl/async-parametric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEzE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAC1D,CAAC,cAAc,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,EAC9C,KAAK,EAAE,OAAO,EAAE,EAAE;IAChB,IAAI,CAAC;QACH,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,MAAM,EAAE,mBAAmB;YAC3B,QAAQ,EAAE,qBAAqB;YAC/B,OAAO,EAAE,uDAAuD;SACjE,CAAC;IACJ,CAAC;AACH,CAAC,EACD;IACE,MAAM,EAAE,oBAAoB;IAC5B,QAAQ,EAAE,S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