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":"bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,mDAAuE;AAEvE,qCAAqC;AAErC
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/bootstrap.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,mDAAuE;AAEvE,qCAAqC;AAErC;;;;;;;GAOG;AACH,MAAM,SAAS,GAAG,GAGhB,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAS,EACvC,yBAAc,EACd,0BAAe,CAChB,CAAC,CAAC,GAAG,yBAAc,EAAE,GAAG,0BAAe,CAAC,CAAC,CAAC;IAE3C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;AAExB,MAAM;AACJ;;;;;;GAMG;AACH,MAAM;AACN;;;;;;GAMG;AACH,WAAW,GACZ,GAAG,GAAG,CAAC;AAEC,wBAAM;AAAE,kCAAW"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff utilities for generating rich assertion failure output.
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for extracting meaningful actual/expected
|
|
5
|
+
* values from Zod validation errors and generating high-quality diff output
|
|
6
|
+
* using `jest-diff` for assertion failures.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
* @see {@link https://npm.im/jest-diff | jest-diff}
|
|
10
|
+
*/
|
|
11
|
+
import type { DiffOptions } from 'jest-diff';
|
|
12
|
+
import type { z } from 'zod/v4';
|
|
13
|
+
export type { DiffOptions };
|
|
14
|
+
/**
|
|
15
|
+
* Result of extracting diff values from a `ZodError`
|
|
16
|
+
*/
|
|
17
|
+
export interface DiffValues {
|
|
18
|
+
/** The actual value that was validated */
|
|
19
|
+
actual: unknown;
|
|
20
|
+
/** The expected value (corrected version) */
|
|
21
|
+
expected: unknown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Extracts actual and expected values from a `ZodError` for meaningful diffs.
|
|
25
|
+
*
|
|
26
|
+
* @function
|
|
27
|
+
* @param zodError The `ZodError` to extract values from
|
|
28
|
+
* @param subject The original subject that failed validation
|
|
29
|
+
* @returns Object with actual and expected values for diff
|
|
30
|
+
*/
|
|
31
|
+
export declare const extractDiffValues: (zodError: z.ZodError, subject: unknown) => DiffValues;
|
|
32
|
+
/**
|
|
33
|
+
* Generates a rich diff string using jest-diff for assertion failures.
|
|
34
|
+
*
|
|
35
|
+
* @function
|
|
36
|
+
* @param expected The expected value
|
|
37
|
+
* @param actual The actual value
|
|
38
|
+
* @param options Configuration options for diff generation
|
|
39
|
+
* @returns A formatted diff string, or null if values are identical
|
|
40
|
+
*/
|
|
41
|
+
export declare const generateDiff: (expected: unknown, actual: unknown, options?: DiffOptions) => null | string;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if two values should generate a meaningful diff.
|
|
44
|
+
*
|
|
45
|
+
* @function
|
|
46
|
+
* @param actual The actual value
|
|
47
|
+
* @param expected The expected value
|
|
48
|
+
* @returns True if a diff should be generated, false otherwise
|
|
49
|
+
*/
|
|
50
|
+
export declare const shouldGenerateDiff: (actual: unknown, expected: unknown) => boolean;
|
|
51
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAGhC,YAAY,EAAE,WAAW,EAAE,CAAC;AAO5B;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,CAAC,CAAC,QAAQ,EACpB,SAAS,OAAO,KACf,UA4GF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,OAAO,EACjB,QAAQ,OAAO,EACf,UAAS,WAAgB,KACxB,IAAI,GAAG,MAYT,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,OAAO,EACf,UAAU,OAAO,KAChB,OACoE,CAAC"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Diff utilities for generating rich assertion failure output.
|
|
4
|
+
*
|
|
5
|
+
* This module provides utilities for extracting meaningful actual/expected
|
|
6
|
+
* values from Zod validation errors and generating high-quality diff output
|
|
7
|
+
* using `jest-diff` for assertion failures.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
* @see {@link https://npm.im/jest-diff | jest-diff}
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.shouldGenerateDiff = exports.generateDiff = exports.extractDiffValues = void 0;
|
|
14
|
+
const jest_diff_1 = require("jest-diff");
|
|
15
|
+
const { isArray } = Array;
|
|
16
|
+
const { max } = Math;
|
|
17
|
+
const { stringify } = JSON;
|
|
18
|
+
const { entries } = Object;
|
|
19
|
+
/**
|
|
20
|
+
* Extracts actual and expected values from a `ZodError` for meaningful diffs.
|
|
21
|
+
*
|
|
22
|
+
* @function
|
|
23
|
+
* @param zodError The `ZodError` to extract values from
|
|
24
|
+
* @param subject The original subject that failed validation
|
|
25
|
+
* @returns Object with actual and expected values for diff
|
|
26
|
+
*/
|
|
27
|
+
const extractDiffValues = (zodError, subject) => {
|
|
28
|
+
try {
|
|
29
|
+
// Start with the original subject as the actual value
|
|
30
|
+
const actual = subject;
|
|
31
|
+
// Create a copy to modify as the expected value
|
|
32
|
+
let expected = subject != null ? deepClone(subject) : subject;
|
|
33
|
+
// Process each issue to build the expected value
|
|
34
|
+
for (const issue of zodError.issues) {
|
|
35
|
+
try {
|
|
36
|
+
// Filter path to only string/number keys (symbols are rare in practice)
|
|
37
|
+
const filteredPath = issue.path.filter((key) => typeof key === 'string' || typeof key === 'number');
|
|
38
|
+
switch (issue.code) {
|
|
39
|
+
case 'invalid_type': {
|
|
40
|
+
const correctedValue = createCorrectValueForType(issue.expected, getValueAtPath(actual, filteredPath));
|
|
41
|
+
expected = setValueAtPath(expected, filteredPath, correctedValue);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case 'invalid_value': {
|
|
45
|
+
// For literal/enum errors, use the first valid value
|
|
46
|
+
const correctedValue = issue.values && issue.values.length > 0
|
|
47
|
+
? issue.values[0]
|
|
48
|
+
: '<valid value>';
|
|
49
|
+
expected = setValueAtPath(expected, filteredPath, correctedValue);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 'too_big': {
|
|
53
|
+
const actualValue = getValueAtPath(actual, filteredPath);
|
|
54
|
+
let correctedValue;
|
|
55
|
+
if (issue.origin === 'string' && typeof actualValue === 'string') {
|
|
56
|
+
correctedValue = actualValue.slice(0, Number(issue.maximum));
|
|
57
|
+
}
|
|
58
|
+
else if (issue.origin === 'array' && isArray(actualValue)) {
|
|
59
|
+
correctedValue = actualValue.slice(0, Number(issue.maximum));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
correctedValue = issue.maximum;
|
|
63
|
+
}
|
|
64
|
+
expected = setValueAtPath(expected, filteredPath, correctedValue);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case 'too_small': {
|
|
68
|
+
const actualValue = getValueAtPath(actual, filteredPath);
|
|
69
|
+
let correctedValue;
|
|
70
|
+
if (issue.origin === 'string' && typeof actualValue === 'string') {
|
|
71
|
+
const needed = Number(issue.minimum) - actualValue.length;
|
|
72
|
+
correctedValue = actualValue + 'x'.repeat(max(0, needed));
|
|
73
|
+
}
|
|
74
|
+
else if (issue.origin === 'array' && isArray(actualValue)) {
|
|
75
|
+
const needed = Number(issue.minimum) - actualValue.length;
|
|
76
|
+
correctedValue = actualValue.concat(new Array(max(0, needed)).fill(null));
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
correctedValue = issue.minimum;
|
|
80
|
+
}
|
|
81
|
+
expected = setValueAtPath(expected, filteredPath, correctedValue);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case 'unrecognized_keys': {
|
|
85
|
+
// Remove unrecognized keys from expected
|
|
86
|
+
if (filteredPath.length === 0 &&
|
|
87
|
+
typeof expected === 'object' &&
|
|
88
|
+
expected !== null) {
|
|
89
|
+
const expectedCopy = {
|
|
90
|
+
...expected,
|
|
91
|
+
};
|
|
92
|
+
for (const key of issue.keys) {
|
|
93
|
+
delete expectedCopy[key];
|
|
94
|
+
}
|
|
95
|
+
expected = expectedCopy;
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
default: {
|
|
100
|
+
// For other error types, just mark that something should be different
|
|
101
|
+
// but don't try to guess what the correct value should be
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// If we can't process an individual issue, continue with others
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { actual, expected };
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// If anything goes wrong, return undefined to fall back to pretty error
|
|
115
|
+
return { actual: undefined, expected: undefined };
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
exports.extractDiffValues = extractDiffValues;
|
|
119
|
+
/**
|
|
120
|
+
* Generates a rich diff string using jest-diff for assertion failures.
|
|
121
|
+
*
|
|
122
|
+
* @function
|
|
123
|
+
* @param expected The expected value
|
|
124
|
+
* @param actual The actual value
|
|
125
|
+
* @param options Configuration options for diff generation
|
|
126
|
+
* @returns A formatted diff string, or null if values are identical
|
|
127
|
+
*/
|
|
128
|
+
const generateDiff = (expected, actual, options = {}) => {
|
|
129
|
+
if (!(0, exports.shouldGenerateDiff)(actual, expected)) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
return (0, jest_diff_1.diff)(expected, actual, {
|
|
133
|
+
aAnnotation: 'expected',
|
|
134
|
+
bAnnotation: 'actual',
|
|
135
|
+
expand: false,
|
|
136
|
+
includeChangeCounts: true,
|
|
137
|
+
...options,
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
exports.generateDiff = generateDiff;
|
|
141
|
+
/**
|
|
142
|
+
* Checks if two values should generate a meaningful diff.
|
|
143
|
+
*
|
|
144
|
+
* @function
|
|
145
|
+
* @param actual The actual value
|
|
146
|
+
* @param expected The expected value
|
|
147
|
+
* @returns True if a diff should be generated, false otherwise
|
|
148
|
+
*/
|
|
149
|
+
const shouldGenerateDiff = (actual, expected) => actual !== undefined && expected !== undefined && actual !== expected;
|
|
150
|
+
exports.shouldGenerateDiff = shouldGenerateDiff;
|
|
151
|
+
/**
|
|
152
|
+
* Creates a corrected value for a given type
|
|
153
|
+
*
|
|
154
|
+
* @function
|
|
155
|
+
*/
|
|
156
|
+
const createCorrectValueForType = (expectedType, actualValue) => {
|
|
157
|
+
switch (expectedType) {
|
|
158
|
+
case 'array':
|
|
159
|
+
return isArray(actualValue) ? actualValue : [];
|
|
160
|
+
case 'boolean':
|
|
161
|
+
return typeof actualValue === 'boolean'
|
|
162
|
+
? actualValue
|
|
163
|
+
: Boolean(actualValue);
|
|
164
|
+
case 'null':
|
|
165
|
+
return null;
|
|
166
|
+
case 'number':
|
|
167
|
+
return typeof actualValue === 'number'
|
|
168
|
+
? actualValue
|
|
169
|
+
: Number(actualValue) || 0;
|
|
170
|
+
case 'object':
|
|
171
|
+
return typeof actualValue === 'object' && actualValue !== null
|
|
172
|
+
? actualValue
|
|
173
|
+
: {};
|
|
174
|
+
case 'string':
|
|
175
|
+
if (typeof actualValue === 'string') {
|
|
176
|
+
return actualValue;
|
|
177
|
+
}
|
|
178
|
+
if (actualValue == null) {
|
|
179
|
+
return '';
|
|
180
|
+
}
|
|
181
|
+
if (typeof actualValue === 'object') {
|
|
182
|
+
return stringify(actualValue);
|
|
183
|
+
}
|
|
184
|
+
// For primitive types (number, boolean, etc.) - we know it's not an object here
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
186
|
+
return `${actualValue}`;
|
|
187
|
+
case 'undefined':
|
|
188
|
+
return undefined;
|
|
189
|
+
default:
|
|
190
|
+
return `<${expectedType}>`;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Custom deep clone implementation for values that structuredClone can't
|
|
195
|
+
* handle. Used as fallback when structuredClone fails.
|
|
196
|
+
*
|
|
197
|
+
* @function
|
|
198
|
+
*/
|
|
199
|
+
const customDeepClone = (value) => {
|
|
200
|
+
if (value === null || typeof value !== 'object') {
|
|
201
|
+
return value;
|
|
202
|
+
}
|
|
203
|
+
if (isArray(value)) {
|
|
204
|
+
return value.map(customDeepClone);
|
|
205
|
+
}
|
|
206
|
+
// For objects, create a new object and copy properties
|
|
207
|
+
const cloned = {};
|
|
208
|
+
for (const [key, val] of entries(value)) {
|
|
209
|
+
cloned[key] = customDeepClone(val);
|
|
210
|
+
}
|
|
211
|
+
return cloned;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Deep clone a value to avoid mutating the original. Uses the native
|
|
215
|
+
* structuredClone API which handles more types and circular references better
|
|
216
|
+
* than a custom implementation. Falls back to custom implementation for values
|
|
217
|
+
* containing functions.
|
|
218
|
+
*
|
|
219
|
+
* @function
|
|
220
|
+
*/
|
|
221
|
+
const deepClone = (value) => {
|
|
222
|
+
try {
|
|
223
|
+
return structuredClone(value);
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
// Handle DataCloneError for values that can't be cloned (functions, symbols, etc.)
|
|
227
|
+
if (error instanceof Error && error.name === 'DataCloneError') {
|
|
228
|
+
return customDeepClone(value);
|
|
229
|
+
}
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Gets a value at a specific path in an object
|
|
235
|
+
*
|
|
236
|
+
* @function
|
|
237
|
+
*/
|
|
238
|
+
const getValueAtPath = (obj, path) => {
|
|
239
|
+
if (path.length === 0) {
|
|
240
|
+
return obj;
|
|
241
|
+
}
|
|
242
|
+
let current = obj;
|
|
243
|
+
for (const key of path) {
|
|
244
|
+
if (current == null) {
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
current = current[key];
|
|
248
|
+
}
|
|
249
|
+
return current;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Returns a new object with the value at the specified path set to the given
|
|
253
|
+
* value.
|
|
254
|
+
*
|
|
255
|
+
* @function
|
|
256
|
+
*/
|
|
257
|
+
const setValueAtPath = (obj, path, value) => {
|
|
258
|
+
if (path.length === 0) {
|
|
259
|
+
return value;
|
|
260
|
+
}
|
|
261
|
+
if (obj == null) {
|
|
262
|
+
// Need to create the structure
|
|
263
|
+
obj = typeof path[0] === 'number' ? [] : {};
|
|
264
|
+
}
|
|
265
|
+
const result = isArray(obj)
|
|
266
|
+
? [...obj]
|
|
267
|
+
: { ...obj };
|
|
268
|
+
const [head, ...tail] = path;
|
|
269
|
+
if (head !== undefined) {
|
|
270
|
+
if (tail.length === 0) {
|
|
271
|
+
result[head] = value;
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
result[head] = setValueAtPath(result[head], tail, value);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return result;
|
|
278
|
+
};
|
|
279
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/diff.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAKH,yCAAiC;AAGjC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AAC1B,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACrB,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;AAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;AAY3B;;;;;;;GAOG;AACI,MAAM,iBAAiB,GAAG,CAC/B,QAAoB,EACpB,OAAgB,EACJ,EAAE;IACd,IAAI,CAAC;QACH,sDAAsD;QACtD,MAAM,MAAM,GAAG,OAAO,CAAC;QAEvB,gDAAgD;Q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D,IAAI,EACJ,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/commonjs/error.d.ts
CHANGED
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { AssertionError as NodeAssertionError } from 'node:assert';
|
|
9
9
|
import { kBupkisError } from './constant.js';
|
|
10
|
+
/**
|
|
11
|
+
* Options for {@link AssertionError}'s constructor
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Based on Node.js' {@link NodeAssertionError}'s constructor options, sans
|
|
15
|
+
* `operator`.
|
|
16
|
+
* @group Error Options
|
|
17
|
+
*/
|
|
18
|
+
export type AssertionErrorOptions = Partial<Omit<NonNullable<ConstructorParameters<typeof NodeAssertionError>[0]>, 'operator'>>;
|
|
10
19
|
/**
|
|
11
20
|
* Options for {@link AssertionImplementationError}
|
|
12
21
|
*
|
|
@@ -30,7 +39,7 @@ export interface InvalidMetadataErrorOptions extends ErrorOptions {
|
|
|
30
39
|
metadata?: unknown;
|
|
31
40
|
}
|
|
32
41
|
/**
|
|
33
|
-
* Options for {@link
|
|
42
|
+
* Options for {@link InvalidObjectSchemaError}
|
|
34
43
|
*
|
|
35
44
|
* @group Error Options
|
|
36
45
|
*/
|
|
@@ -61,6 +70,7 @@ export interface UnknownAssertionErrorOptions<T extends readonly unknown[]> exte
|
|
|
61
70
|
*/
|
|
62
71
|
export declare class AssertionError extends NodeAssertionError {
|
|
63
72
|
name: string;
|
|
73
|
+
constructor(options?: AssertionErrorOptions);
|
|
64
74
|
/**
|
|
65
75
|
* Type guard for an instance of this error.
|
|
66
76
|
*
|
|
@@ -68,6 +78,13 @@ export declare class AssertionError extends NodeAssertionError {
|
|
|
68
78
|
* @returns `true` if `value` is an instance of `AssertionError`
|
|
69
79
|
*/
|
|
70
80
|
static isAssertionError(value: unknown): value is AssertionError;
|
|
81
|
+
toJSON(): {
|
|
82
|
+
actual: unknown;
|
|
83
|
+
expected: unknown;
|
|
84
|
+
message: string;
|
|
85
|
+
name: string;
|
|
86
|
+
stack: string | undefined;
|
|
87
|
+
};
|
|
71
88
|
}
|
|
72
89
|
/**
|
|
73
90
|
* Base class for all custom errors thrown by <span
|
|
@@ -93,6 +110,7 @@ export declare class AssertionImplementationError extends BupkisError {
|
|
|
93
110
|
name: string;
|
|
94
111
|
readonly result: unknown;
|
|
95
112
|
constructor(message: string, options?: AssertionImplementationErrorOptions);
|
|
113
|
+
static isAssertionImplementationError(err: unknown): err is AssertionImplementationError;
|
|
96
114
|
}
|
|
97
115
|
/**
|
|
98
116
|
* Variant of an {@link AssertionError} that is thrown when
|
|
@@ -119,16 +137,31 @@ export declare class InvalidMetadataError extends BupkisError {
|
|
|
119
137
|
constructor(message: string, options?: InvalidMetadataErrorOptions);
|
|
120
138
|
}
|
|
121
139
|
/**
|
|
122
|
-
* Thrown from certain assertions when
|
|
140
|
+
* Thrown from certain assertions when a parameter cannot be used as an "object
|
|
141
|
+
* schema"
|
|
123
142
|
*
|
|
124
143
|
* @group Errors
|
|
125
144
|
*/
|
|
126
|
-
export declare class
|
|
127
|
-
readonly code = "
|
|
145
|
+
export declare class InvalidObjectSchemaError extends BupkisError {
|
|
146
|
+
readonly code = "ERR_BUPKIS_INVALID_OBJECT_SCHEMA";
|
|
128
147
|
name: string;
|
|
129
148
|
readonly schema?: unknown;
|
|
130
149
|
constructor(message: string, options?: InvalidSchemaErrorOptions);
|
|
131
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Thrown when a value cannot be converted to a schema using `valueToSchema()`.
|
|
153
|
+
*
|
|
154
|
+
* @remarks
|
|
155
|
+
* Currently, this includes the presence of an own property `__proto__` or an
|
|
156
|
+
* empty object (because this will match anything; though maybe we should change
|
|
157
|
+
* that).
|
|
158
|
+
* @group Errors
|
|
159
|
+
*/
|
|
160
|
+
export declare class SatisfactionError extends BupkisError {
|
|
161
|
+
readonly code = "ERR_BUPKIS_SATISFACTION";
|
|
162
|
+
name: string;
|
|
163
|
+
constructor(message: string, options?: ErrorOptions);
|
|
164
|
+
}
|
|
132
165
|
/**
|
|
133
166
|
* Thrown when `expect()` is called with something async.
|
|
134
167
|
*
|
|
@@ -150,18 +183,4 @@ export declare class UnknownAssertionError<T extends readonly unknown[]> extends
|
|
|
150
183
|
name: string;
|
|
151
184
|
constructor(message: string, options: UnknownAssertionErrorOptions<T>);
|
|
152
185
|
}
|
|
153
|
-
/**
|
|
154
|
-
* Thrown when a value cannot be converted to a schema using `valueToSchema()`.
|
|
155
|
-
*
|
|
156
|
-
* @remarks
|
|
157
|
-
* Currently, this includes the presence of an own property `__proto__` or an
|
|
158
|
-
* empty object (because this will match anything; though maybe we should change
|
|
159
|
-
* that).
|
|
160
|
-
* @group Errors
|
|
161
|
-
*/
|
|
162
|
-
export declare class ValueToSchemaError extends BupkisError {
|
|
163
|
-
readonly code = "ERR_BUPKIS_SATISFACTION";
|
|
164
|
-
name: string;
|
|
165
|
-
constructor(message: string, options?: ErrorOptions);
|
|
166
|
-
}
|
|
167
186
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAEL,YAAY,EAGb,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EAEL,YAAY,EAGb,MAAM,eAAe,CAAC;AAKvB;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,IAAI,CACF,WAAW,CAAC,qBAAqB,CAAC,OAAO,kBAAkB,CA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ule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.UnknownAssertionError = exports.UnexpectedAsyncError = exports.SatisfactionError = exports.NegatedAssertionError = exports.InvalidObjectSchemaError = exports.InvalidMetadataError = exports.FailAssertionError = exports.AssertionImplementationError = exports.BupkisError = exports.AssertionError = void 0;
|
|
11
11
|
const node_assert_1 = require("node:assert");
|
|
12
12
|
const constant_js_1 = require("./constant.js");
|
|
13
13
|
const guards_js_1 = require("./guards.js");
|
|
14
|
+
const { hasOwn } = Object;
|
|
14
15
|
/**
|
|
15
16
|
* _BUPKIS_' s custom `AssertionError` class, which is just a thin wrapper
|
|
16
17
|
* around Node.js' {@link NodeAssertionError AssertionError}.
|
|
@@ -24,6 +25,9 @@ class AssertionError extends node_assert_1.AssertionError {
|
|
|
24
25
|
*/
|
|
25
26
|
[constant_js_1.kBupkisAssertionError] = true;
|
|
26
27
|
name = 'AssertionError';
|
|
28
|
+
constructor(options) {
|
|
29
|
+
super(options);
|
|
30
|
+
}
|
|
27
31
|
/**
|
|
28
32
|
* Type guard for an instance of this error.
|
|
29
33
|
*
|
|
@@ -31,8 +35,16 @@ class AssertionError extends node_assert_1.AssertionError {
|
|
|
31
35
|
* @returns `true` if `value` is an instance of `AssertionError`
|
|
32
36
|
*/
|
|
33
37
|
static isAssertionError(value) {
|
|
34
|
-
return ((0, guards_js_1.isA)(value, node_assert_1.AssertionError) &&
|
|
35
|
-
|
|
38
|
+
return ((0, guards_js_1.isA)(value, node_assert_1.AssertionError) && hasOwn(value, constant_js_1.kBupkisAssertionError));
|
|
39
|
+
}
|
|
40
|
+
toJSON() {
|
|
41
|
+
return {
|
|
42
|
+
actual: this.actual,
|
|
43
|
+
expected: this.expected,
|
|
44
|
+
message: this.message,
|
|
45
|
+
name: this.name,
|
|
46
|
+
stack: this.stack,
|
|
47
|
+
};
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
exports.AssertionError = AssertionError;
|
|
@@ -48,7 +60,7 @@ class BupkisError extends Error {
|
|
|
48
60
|
[constant_js_1.kBupkisError] = true;
|
|
49
61
|
name = 'BupkisError';
|
|
50
62
|
static isBupkisError(err) {
|
|
51
|
-
return (0, guards_js_1.isA)(err, Error) &&
|
|
63
|
+
return (0, guards_js_1.isA)(err, Error) && hasOwn(err, constant_js_1.kBupkisError);
|
|
52
64
|
}
|
|
53
65
|
}
|
|
54
66
|
exports.BupkisError = BupkisError;
|
|
@@ -67,6 +79,9 @@ class AssertionImplementationError extends BupkisError {
|
|
|
67
79
|
super(message, rest);
|
|
68
80
|
this.result = result;
|
|
69
81
|
}
|
|
82
|
+
static isAssertionImplementationError(err) {
|
|
83
|
+
return (0, guards_js_1.isA)(err, AssertionImplementationError);
|
|
84
|
+
}
|
|
70
85
|
}
|
|
71
86
|
exports.AssertionImplementationError = AssertionImplementationError;
|
|
72
87
|
/**
|
|
@@ -82,8 +97,7 @@ class FailAssertionError extends AssertionError {
|
|
|
82
97
|
[constant_js_1.kBupkisFailAssertionError] = true;
|
|
83
98
|
name = 'FailAssertionError';
|
|
84
99
|
static isFailAssertionError(err) {
|
|
85
|
-
return ((0, guards_js_1.isA)(err, FailAssertionError) &&
|
|
86
|
-
Object.hasOwn(err, constant_js_1.kBupkisFailAssertionError));
|
|
100
|
+
return ((0, guards_js_1.isA)(err, FailAssertionError) && hasOwn(err, constant_js_1.kBupkisFailAssertionError));
|
|
87
101
|
}
|
|
88
102
|
}
|
|
89
103
|
exports.FailAssertionError = FailAssertionError;
|
|
@@ -107,13 +121,14 @@ class InvalidMetadataError extends BupkisError {
|
|
|
107
121
|
}
|
|
108
122
|
exports.InvalidMetadataError = InvalidMetadataError;
|
|
109
123
|
/**
|
|
110
|
-
* Thrown from certain assertions when
|
|
124
|
+
* Thrown from certain assertions when a parameter cannot be used as an "object
|
|
125
|
+
* schema"
|
|
111
126
|
*
|
|
112
127
|
* @group Errors
|
|
113
128
|
*/
|
|
114
|
-
class
|
|
115
|
-
code = '
|
|
116
|
-
name = '
|
|
129
|
+
class InvalidObjectSchemaError extends BupkisError {
|
|
130
|
+
code = 'ERR_BUPKIS_INVALID_OBJECT_SCHEMA';
|
|
131
|
+
name = 'InvalidObjectSchemaError';
|
|
117
132
|
schema;
|
|
118
133
|
constructor(message, options = {}) {
|
|
119
134
|
const { schema, ...rest } = options;
|
|
@@ -121,7 +136,7 @@ class InvalidSchemaError extends BupkisError {
|
|
|
121
136
|
this.schema = schema;
|
|
122
137
|
}
|
|
123
138
|
}
|
|
124
|
-
exports.
|
|
139
|
+
exports.InvalidObjectSchemaError = InvalidObjectSchemaError;
|
|
125
140
|
/**
|
|
126
141
|
* Error type used internally to catch failed negated assertions.
|
|
127
142
|
*
|
|
@@ -132,11 +147,27 @@ class NegatedAssertionError extends AssertionError {
|
|
|
132
147
|
[constant_js_1.kBupkisNegatedAssertionError] = true;
|
|
133
148
|
name = 'NegatedAssertionError';
|
|
134
149
|
static isNegatedAssertionError(err) {
|
|
135
|
-
return ((0, guards_js_1.isA)(err, AssertionError) &&
|
|
136
|
-
Object.hasOwn(err, constant_js_1.kBupkisNegatedAssertionError));
|
|
150
|
+
return ((0, guards_js_1.isA)(err, AssertionError) && hasOwn(err, constant_js_1.kBupkisNegatedAssertionError));
|
|
137
151
|
}
|
|
138
152
|
}
|
|
139
153
|
exports.NegatedAssertionError = NegatedAssertionError;
|
|
154
|
+
/**
|
|
155
|
+
* Thrown when a value cannot be converted to a schema using `valueToSchema()`.
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* Currently, this includes the presence of an own property `__proto__` or an
|
|
159
|
+
* empty object (because this will match anything; though maybe we should change
|
|
160
|
+
* that).
|
|
161
|
+
* @group Errors
|
|
162
|
+
*/
|
|
163
|
+
class SatisfactionError extends BupkisError {
|
|
164
|
+
code = 'ERR_BUPKIS_SATISFACTION';
|
|
165
|
+
name = 'SatisfactionError';
|
|
166
|
+
constructor(message, options = {}) {
|
|
167
|
+
super(message, options);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.SatisfactionError = SatisfactionError;
|
|
140
171
|
/**
|
|
141
172
|
* Thrown when `expect()` is called with something async.
|
|
142
173
|
*
|
|
@@ -164,21 +195,4 @@ class UnknownAssertionError extends BupkisError {
|
|
|
164
195
|
}
|
|
165
196
|
}
|
|
166
197
|
exports.UnknownAssertionError = UnknownAssertionError;
|
|
167
|
-
/**
|
|
168
|
-
* Thrown when a value cannot be converted to a schema using `valueToSchema()`.
|
|
169
|
-
*
|
|
170
|
-
* @remarks
|
|
171
|
-
* Currently, this includes the presence of an own property `__proto__` or an
|
|
172
|
-
* empty object (because this will match anything; though maybe we should change
|
|
173
|
-
* that).
|
|
174
|
-
* @group Errors
|
|
175
|
-
*/
|
|
176
|
-
class ValueToSchemaError extends BupkisError {
|
|
177
|
-
code = 'ERR_BUPKIS_SATISFACTION';
|
|
178
|
-
name = 'SatisfactionError';
|
|
179
|
-
constructor(message, options = {}) {
|
|
180
|
-
super(message, options);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
exports.ValueToSchemaError = ValueToSchemaError;
|
|
184
198
|
//# sourceMappingURL=error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,6CAAmE;AAEnE,+CAKuB;AACvB,2CAAkC;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,6CAAmE;AAEnE,+CAKuB;AACvB,2CAAkC;AAElC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;AAkE1B;;;;;;GAMG;AACH,MAAa,cAAe,SAAQ,4BAAkB;IACpD;;OAEG;IACH,CAAC,mCAAqB,CAAC,GAAG,IAAI,CAAC;IAEtB,IAAI,GAAG,gBAAgB,CAAC;IAEjC,YAAY,OAA+B;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC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EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,0CAA4B,CAAC,CACtE,CAAC;IACJ,CAAC;CACF;AAVD,sDAUC;AAED;;;;;;;;GAQG;AACH,MAAa,iBAAkB,SAAQ,WAAW;IACvC,IAAI,GAAG,yBAAyB,CAAC;IAEjC,IAAI,GAAG,mBAAmB,CAAC;IAEpC,YAAY,OAAe,EAAE,UAAwB,EAAE;QACrD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF;AARD,8CAQC;AAED;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,WAAW;IAC1C,IAAI,GAAG,6BAA6B,CAAC;IAErC,IAAI,GAAG,sBAAsB,CAAC;CACxC;AAJD,oDAIC;AAED;;;;;GAKG;AACH,MAAa,qBAEX,SAAQ,WAAW;IACV,IAAI,CAAI;IAER,IAAI,GAAG,8BAA8B,CAAC;IAEtC,IAAI,GAAG,uBAAuB,CAAC;IAExC,YAAY,OAAe,EAAE,OAAwC;QACnE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;QAClC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAdD,sDAcC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/expect.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EASvB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/expect.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EASvB,MAAM,gCAAgC,CAAC;AAUxC,OAAO,EACL,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KA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