@overkill-dev/doubles 0.0.1 → 0.0.2
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/LICENSE +21 -0
- package/assert/assertion-extension.d.ts +65 -0
- package/assert/assertion-extension.d.ts.map +1 -0
- package/assert/assertion-extension.js +250 -0
- package/assert/assertion-extension.js.map +1 -0
- package/assertion-protocol/assertion-evaluation.d.ts +13 -0
- package/assertion-protocol/assertion-evaluation.d.ts.map +1 -0
- package/assertion-protocol/assertion-node-shape.d.ts +71 -0
- package/assertion-protocol/assertion-node-shape.d.ts.map +1 -0
- package/assertion-protocol/assertion-node.d.ts +97 -0
- package/assertion-protocol/assertion-node.d.ts.map +1 -0
- package/assertion-protocol/assertion-reference.d.ts +73 -0
- package/assertion-protocol/assertion-reference.d.ts.map +1 -0
- package/assertion-protocol/assertion-reference.js +49 -0
- package/assertion-protocol/assertion-reference.js.map +1 -0
- package/assertion-protocol/assertions/boolean.d.ts +11 -0
- package/assertion-protocol/assertions/boolean.d.ts.map +1 -0
- package/assertion-protocol/assertions/collection.d.ts +22 -0
- package/assertion-protocol/assertions/collection.d.ts.map +1 -0
- package/assertion-protocol/assertions/equality.d.ts +17 -0
- package/assertion-protocol/assertions/equality.d.ts.map +1 -0
- package/assertion-protocol/assertions/fail.d.ts +13 -0
- package/assertion-protocol/assertions/fail.d.ts.map +1 -0
- package/assertion-protocol/assertions/numeric.d.ts +29 -0
- package/assertion-protocol/assertions/numeric.d.ts.map +1 -0
- package/assertion-protocol/assertions/partial.d.ts +14 -0
- package/assertion-protocol/assertions/partial.d.ts.map +1 -0
- package/assertion-protocol/assertions/presence.d.ts +17 -0
- package/assertion-protocol/assertions/presence.d.ts.map +1 -0
- package/assertion-protocol/assertions/string.d.ts +28 -0
- package/assertion-protocol/assertions/string.d.ts.map +1 -0
- package/assertion-protocol/assertions/type-shape.d.ts +42 -0
- package/assertion-protocol/assertions/type-shape.d.ts.map +1 -0
- package/assertion-protocol/thrown-error-record.d.ts +8 -0
- package/assertion-protocol/thrown-error-record.d.ts.map +1 -0
- package/assertion-protocol/thrown-error-record.js +17 -0
- package/assertion-protocol/thrown-error-record.js.map +1 -0
- package/assertion-protocol/thrown-matcher.d.ts +51 -0
- package/assertion-protocol/thrown-matcher.d.ts.map +1 -0
- package/assertion-protocol/thrown-matcher.js +186 -0
- package/assertion-protocol/thrown-matcher.js.map +1 -0
- package/compare/comparison-result.d.ts +25 -0
- package/compare/comparison-result.d.ts.map +1 -0
- package/compare/comparison-state.d.ts +7 -0
- package/compare/comparison-state.d.ts.map +1 -0
- package/compare/comparison-state.js +20 -0
- package/compare/comparison-state.js.map +1 -0
- package/compare/comparison.d.ts +12 -0
- package/compare/comparison.d.ts.map +1 -0
- package/compare/raw-comparison.d.ts +24 -0
- package/compare/raw-comparison.d.ts.map +1 -0
- package/compare/raw-comparison.js +285 -0
- package/compare/raw-comparison.js.map +1 -0
- package/compare/serialized-value-shape.d.ts +143 -0
- package/compare/serialized-value-shape.d.ts.map +1 -0
- package/compare/serialized-value.d.ts +11 -0
- package/compare/serialized-value.d.ts.map +1 -0
- package/compare/value-classification.d.ts +26 -0
- package/compare/value-classification.d.ts.map +1 -0
- package/compare/value-classification.js +110 -0
- package/compare/value-classification.js.map +1 -0
- package/diff/diff-shape.d.ts +117 -0
- package/diff/diff-shape.d.ts.map +1 -0
- package/doubles/disposal-symbol.d.ts +3 -0
- package/doubles/disposal-symbol.d.ts.map +1 -0
- package/doubles/disposal-symbol.js +10 -0
- package/doubles/disposal-symbol.js.map +1 -0
- package/doubles/double-behavior.d.ts +106 -0
- package/doubles/double-behavior.d.ts.map +1 -0
- package/doubles/double-behavior.js +257 -0
- package/doubles/double-behavior.js.map +1 -0
- package/doubles/double-chronology.d.ts +21 -0
- package/doubles/double-chronology.d.ts.map +1 -0
- package/doubles/double-chronology.js +78 -0
- package/doubles/double-chronology.js.map +1 -0
- package/doubles/double-history-api.d.ts +33 -0
- package/doubles/double-history-api.d.ts.map +1 -0
- package/doubles/double-history-api.js +125 -0
- package/doubles/double-history-api.js.map +1 -0
- package/doubles/double-history-record.d.ts +82 -0
- package/doubles/double-history-record.d.ts.map +1 -0
- package/doubles/double-history-record.js +65 -0
- package/doubles/double-history-record.js.map +1 -0
- package/doubles/double-history-store.d.ts +21 -0
- package/doubles/double-history-store.d.ts.map +1 -0
- package/doubles/double-history-store.js +118 -0
- package/doubles/double-history-store.js.map +1 -0
- package/doubles/double-history.d.ts +141 -0
- package/doubles/double-history.d.ts.map +1 -0
- package/doubles/double-history.js +32 -0
- package/doubles/double-history.js.map +1 -0
- package/doubles/double-iterator-event-types.d.ts +25 -0
- package/doubles/double-iterator-event-types.d.ts.map +1 -0
- package/doubles/double-iterator-tracking.d.ts +12 -0
- package/doubles/double-iterator-tracking.d.ts.map +1 -0
- package/doubles/double-iterator-tracking.js +161 -0
- package/doubles/double-iterator-tracking.js.map +1 -0
- package/doubles/double-rule-arguments.d.ts +18 -0
- package/doubles/double-rule-arguments.d.ts.map +1 -0
- package/doubles/double-rule-callback.d.ts +40 -0
- package/doubles/double-rule-callback.d.ts.map +1 -0
- package/doubles/double-rule-callback.js +84 -0
- package/doubles/double-rule-callback.js.map +1 -0
- package/doubles/double-rule-generator.d.ts +108 -0
- package/doubles/double-rule-generator.d.ts.map +1 -0
- package/doubles/double-rule-generator.js +37 -0
- package/doubles/double-rule-generator.js.map +1 -0
- package/doubles/double-rule-types.d.ts +162 -0
- package/doubles/double-rule-types.d.ts.map +1 -0
- package/doubles/double-rule.d.ts +3 -0
- package/doubles/double-rule.d.ts.map +1 -0
- package/doubles/double-rule.js +113 -0
- package/doubles/double-rule.js.map +1 -0
- package/doubles/double-runtime.d.ts +9 -0
- package/doubles/double-runtime.d.ts.map +1 -0
- package/doubles/double-runtime.js +173 -0
- package/doubles/double-runtime.js.map +1 -0
- package/doubles/double-signature.d.ts +5 -0
- package/doubles/double-signature.d.ts.map +1 -0
- package/doubles/double-usage-argument-assertion.d.ts +27 -0
- package/doubles/double-usage-argument-assertion.d.ts.map +1 -0
- package/doubles/double-usage-argument-assertion.js +202 -0
- package/doubles/double-usage-argument-assertion.js.map +1 -0
- package/doubles/double-usage-contract.d.ts +29 -0
- package/doubles/double-usage-contract.d.ts.map +1 -0
- package/doubles/double-usage-contract.js +11 -0
- package/doubles/double-usage-contract.js.map +1 -0
- package/doubles/double-usage-count-assertion.d.ts +6 -0
- package/doubles/double-usage-count-assertion.d.ts.map +1 -0
- package/doubles/double-usage-count-assertion.js +73 -0
- package/doubles/double-usage-count-assertion.js.map +1 -0
- package/doubles/double-usage-disposal-assertion.d.ts +7 -0
- package/doubles/double-usage-disposal-assertion.d.ts.map +1 -0
- package/doubles/double-usage-disposal-assertion.js +175 -0
- package/doubles/double-usage-disposal-assertion.js.map +1 -0
- package/doubles/double-usage-inspection.d.ts +22 -0
- package/doubles/double-usage-inspection.d.ts.map +1 -0
- package/doubles/double-usage-inspection.js +59 -0
- package/doubles/double-usage-inspection.js.map +1 -0
- package/doubles/double-usage-iterator-assertion.d.ts +7 -0
- package/doubles/double-usage-iterator-assertion.d.ts.map +1 -0
- package/doubles/double-usage-iterator-assertion.js +124 -0
- package/doubles/double-usage-iterator-assertion.js.map +1 -0
- package/doubles/double-usage-order-assertion.d.ts +3 -0
- package/doubles/double-usage-order-assertion.d.ts.map +1 -0
- package/doubles/double-usage-order-assertion.js +91 -0
- package/doubles/double-usage-order-assertion.js.map +1 -0
- package/doubles/double-usage.d.ts +81 -0
- package/doubles/double-usage.d.ts.map +1 -0
- package/doubles/double-usage.js +228 -0
- package/doubles/double-usage.js.map +1 -0
- package/doubles/protocol-disposable-double.d.ts +16 -0
- package/doubles/protocol-disposable-double.d.ts.map +1 -0
- package/doubles/protocol-disposable-double.js +37 -0
- package/doubles/protocol-disposable-double.js.map +1 -0
- package/doubles/protocol-double-metadata.d.ts +15 -0
- package/doubles/protocol-double-metadata.d.ts.map +1 -0
- package/doubles/protocol-double-metadata.js +30 -0
- package/doubles/protocol-double-metadata.js.map +1 -0
- package/doubles/protocol-double.d.ts +50 -0
- package/doubles/protocol-double.d.ts.map +1 -0
- package/doubles/protocol-double.js +76 -0
- package/doubles/protocol-double.js.map +1 -0
- package/doubles/protocol-iterator-double.d.ts +93 -0
- package/doubles/protocol-iterator-double.d.ts.map +1 -0
- package/doubles/protocol-iterator-double.js +512 -0
- package/doubles/protocol-iterator-double.js.map +1 -0
- package/doubles/test-double.d.ts +62 -0
- package/doubles/test-double.d.ts.map +1 -0
- package/doubles/test-double.js +192 -0
- package/doubles/test-double.js.map +1 -0
- package/package.json +36 -6
- package/packages/doubles/doubles.entry-point.d.ts +13 -0
- package/packages/doubles/doubles.entry-point.d.ts.map +1 -0
- package/packages/doubles/doubles.entry-point.js +5 -0
- package/packages/doubles/doubles.entry-point.js.map +1 -0
- package/readme.md +423 -5
- package/sbom.cdx.json +30 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { CompositeAssertionChildNode } from './assertion-node.ts';
|
|
2
|
+
import type { AssertionSource, NonEmptyReadonlyArray, ResolvableSourceLocation } from './assertion-node-shape.ts';
|
|
3
|
+
declare const assertionReferenceIdentity: unique symbol;
|
|
4
|
+
declare const assertionReferenceRecordIdentity: unique symbol;
|
|
5
|
+
declare const compositeGroupIdentity: unique symbol;
|
|
6
|
+
export type CompositeAssertionSummaryContext = {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly source: AssertionSource;
|
|
9
|
+
};
|
|
10
|
+
export type CompositeAssertionGroup<Source extends AssertionSource = AssertionSource> = {
|
|
11
|
+
readonly [compositeGroupIdentity]: true;
|
|
12
|
+
readonly children: NonEmptyReadonlyArray<CompositeAssertionChildNode<Source>>;
|
|
13
|
+
};
|
|
14
|
+
type CompositeAssertionReturnByKind<Source extends AssertionSource> = {
|
|
15
|
+
readonly child: CompositeAssertionChildNode<Source>;
|
|
16
|
+
readonly group: CompositeAssertionGroup<Source>;
|
|
17
|
+
};
|
|
18
|
+
export type CompositeAssertionReturn<Source extends AssertionSource = AssertionSource> = CompositeAssertionReturnByKind<Source>[keyof CompositeAssertionReturnByKind<Source>];
|
|
19
|
+
type PromiseCompositeAssertionReturn = Promise<CompositeAssertionReturn<'assert'>>;
|
|
20
|
+
export type AssertCompositeAssertionReturn = CompositeAssertionReturn<'assert'> | PromiseCompositeAssertionReturn;
|
|
21
|
+
type SyncAssertionReturn = ReturnType<() => void>;
|
|
22
|
+
export type CompositeAssertionSummaryFormatter<Arguments extends readonly unknown[]> = (context: CompositeAssertionSummaryContext, ...parameters: Arguments) => string;
|
|
23
|
+
export type NarrowingCompositeAssertionSummaryFormatter<Actual, Arguments extends readonly unknown[]> = (context: CompositeAssertionSummaryContext, actual: Actual, ...parameters: Arguments) => string;
|
|
24
|
+
export type CompositeAssertionRunnerInput<Arguments extends readonly unknown[], Source extends AssertionSource> = {
|
|
25
|
+
readonly location: ResolvableSourceLocation;
|
|
26
|
+
readonly message: string | null;
|
|
27
|
+
readonly parameters: Arguments;
|
|
28
|
+
readonly source: Source;
|
|
29
|
+
};
|
|
30
|
+
export type CompositeAssertionReferenceRecord<Arguments extends readonly unknown[] = readonly unknown[], Result extends AssertCompositeAssertionReturn = AssertCompositeAssertionReturn> = {
|
|
31
|
+
readonly formatSummary: CompositeAssertionSummaryFormatter<Arguments> | null;
|
|
32
|
+
readonly kind: 'composite';
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly run: (input: CompositeAssertionRunnerInput<Arguments, 'assert'>) => Result;
|
|
35
|
+
};
|
|
36
|
+
export type NarrowingCompositeAssertionReferenceRecord<Actual = unknown, Narrowed extends Actual = Actual, Arguments extends readonly unknown[] = readonly unknown[]> = {
|
|
37
|
+
readonly formatSummary: NarrowingCompositeAssertionSummaryFormatter<Actual, Arguments> | null;
|
|
38
|
+
readonly kind: 'narrowing-composite';
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly narrows: (actual: Actual, ...parameters: Arguments) => actual is Narrowed;
|
|
41
|
+
};
|
|
42
|
+
export type AssertionReferenceRecord = CompositeAssertionReferenceRecord | NarrowingCompositeAssertionReferenceRecord;
|
|
43
|
+
export type CompositeAssertionReference<Arguments extends readonly unknown[] = readonly unknown[], Result extends AssertCompositeAssertionReturn = AssertCompositeAssertionReturn> = {
|
|
44
|
+
readonly [assertionReferenceIdentity]: true;
|
|
45
|
+
readonly [assertionReferenceRecordIdentity]: CompositeAssertionReferenceRecord<Arguments, Result>;
|
|
46
|
+
};
|
|
47
|
+
export type NarrowingCompositeAssertionReference<Actual = unknown, Narrowed extends Actual = Actual, Arguments extends readonly unknown[] = readonly unknown[]> = {
|
|
48
|
+
readonly [assertionReferenceIdentity]: true;
|
|
49
|
+
readonly [assertionReferenceRecordIdentity]: NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>;
|
|
50
|
+
};
|
|
51
|
+
export type AssertionReference = CompositeAssertionReference | NarrowingCompositeAssertionReference;
|
|
52
|
+
type NarrowingReferenceArguments<Actual, Arguments extends readonly unknown[]> = readonly [
|
|
53
|
+
actual: Actual,
|
|
54
|
+
...parameters: Arguments
|
|
55
|
+
];
|
|
56
|
+
type ReferenceArguments<Reference> = Reference extends NarrowingCompositeAssertionReference<infer Actual, infer Narrowed, infer Arguments> ? NarrowingReferenceArguments<Actual | Narrowed, Arguments> : never;
|
|
57
|
+
type ReferenceReturn<Result> = Result extends Promise<CompositeAssertionReturn<'assert'>> ? Promise<void> : SyncAssertionReturn;
|
|
58
|
+
type ReadonlyParameters<Arguments extends readonly unknown[]> = readonly [...Arguments];
|
|
59
|
+
export type AssertReferenceArguments<Reference> = Reference extends CompositeAssertionReference<infer Arguments> ? ReadonlyParameters<Arguments> : ReferenceArguments<Reference>;
|
|
60
|
+
export type AssertReferenceReturn<Reference> = Reference extends CompositeAssertionReference<infer Arguments, infer Result> ? Arguments extends readonly unknown[] ? ReferenceReturn<Result> : never : SyncAssertionReturn;
|
|
61
|
+
export declare function createAssertionReferenceRecord<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn>(record: CompositeAssertionReferenceRecord<Arguments, Result>): CompositeAssertionReference<Arguments, Result>;
|
|
62
|
+
export declare function createAssertionReferenceRecord<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]>(record: NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>): NarrowingCompositeAssertionReference<Actual, Narrowed, Arguments>;
|
|
63
|
+
export declare function createCompositeAssertionReferenceRecord<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn>(record: CompositeAssertionReferenceRecord<Arguments, Result>): CompositeAssertionReference<Arguments, Result>;
|
|
64
|
+
export declare function createNarrowingCompositeAssertionReferenceRecord<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]>(record: NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>): NarrowingCompositeAssertionReference<Actual, Narrowed, Arguments>;
|
|
65
|
+
export declare function getAssertionReferenceRecord(reference: AssertionReference): AssertionReferenceRecord;
|
|
66
|
+
export declare function getCompositeAssertionReferenceRecord<Arguments extends readonly unknown[], Result extends AssertCompositeAssertionReturn>(reference: CompositeAssertionReference<Arguments, Result>): CompositeAssertionReferenceRecord<Arguments, Result>;
|
|
67
|
+
export declare function getNarrowingAssertionReferenceRecord<Actual, Narrowed extends Actual, Arguments extends readonly unknown[]>(reference: NarrowingCompositeAssertionReference<Actual, Narrowed, Arguments>): NarrowingCompositeAssertionReferenceRecord<Actual, Narrowed, Arguments>;
|
|
68
|
+
export declare function isAssertionReference(value: unknown): value is AssertionReference;
|
|
69
|
+
export declare function isNarrowingAssertionReference(value: unknown): value is NarrowingCompositeAssertionReference;
|
|
70
|
+
export declare function isCompositeAssertionGroup<Source extends AssertionSource>(value: unknown): value is CompositeAssertionGroup<Source>;
|
|
71
|
+
export declare function createCompositeAssertionGroup<Source extends AssertionSource>(children: NonEmptyReadonlyArray<CompositeAssertionChildNode<Source>>): CompositeAssertionGroup<Source>;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=assertion-reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-reference.d.ts","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,2BAA2B,EAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACR,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EAC3B,MAAM,2BAA2B,CAAC;AAEnC,QAAA,MAAM,0BAA0B,EAAE,OAAO,MAAiD,CAAC;AAC3F,QAAA,MAAM,gCAAgC,EAAE,OAAO,MAAuD,CAAC;AACvG,QAAA,MAAM,sBAAsB,EAAE,OAAO,MAA6C,CAAC;AAEnF,MAAM,MAAM,gCAAgC,GAAG;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IACpF,QAAQ,CAAC,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAC;CACjF,CAAC;AAEF,KAAK,8BAA8B,CAAC,MAAM,SAAS,eAAe,IAAI;IAClE,QAAQ,CAAC,KAAK,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACpD,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,8BAA8B,CACnH,MAAM,CACT,CAAC,MAAM,8BAA8B,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhD,KAAK,+BAA+B,GAAG,OAAO,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEnF,MAAM,MAAM,8B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AC,MAAM,CAAC,CAE1C;AAED,wBAAgB,6BAA6B,CAAC,MAAM,SAAS,eAAe,EACxE,QAAQ,EAAE,qBAAqB,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,GACrE,uBAAuB,CAAC,MAAM,CAAC,CAEjC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const assertionReferenceIdentity = Symbol.for('OverkillAssertionReference');
|
|
2
|
+
const assertionReferenceRecordIdentity = Symbol.for('OverkillAssertionReferenceRecord');
|
|
3
|
+
const compositeGroupIdentity = Symbol.for('OverkillCompositeGroup');
|
|
4
|
+
function ensureAssertionName(name) {
|
|
5
|
+
if (name.trim().length === 0) {
|
|
6
|
+
throw new TypeError('Assertion reference name must not be empty.');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function createAssertionReferenceRecord(record) {
|
|
10
|
+
ensureAssertionName(record.name);
|
|
11
|
+
if (record.kind === 'composite') {
|
|
12
|
+
return {
|
|
13
|
+
[assertionReferenceIdentity]: true,
|
|
14
|
+
[assertionReferenceRecordIdentity]: record
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
[assertionReferenceIdentity]: true,
|
|
19
|
+
[assertionReferenceRecordIdentity]: record
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function createCompositeAssertionReferenceRecord(record) {
|
|
23
|
+
return createAssertionReferenceRecord({ ...record });
|
|
24
|
+
}
|
|
25
|
+
export function createNarrowingCompositeAssertionReferenceRecord(record) {
|
|
26
|
+
return createAssertionReferenceRecord({ ...record });
|
|
27
|
+
}
|
|
28
|
+
export function getAssertionReferenceRecord(reference) {
|
|
29
|
+
return reference[assertionReferenceRecordIdentity];
|
|
30
|
+
}
|
|
31
|
+
export function getCompositeAssertionReferenceRecord(reference) {
|
|
32
|
+
return reference[assertionReferenceRecordIdentity];
|
|
33
|
+
}
|
|
34
|
+
export function getNarrowingAssertionReferenceRecord(reference) {
|
|
35
|
+
return reference[assertionReferenceRecordIdentity];
|
|
36
|
+
}
|
|
37
|
+
export function isAssertionReference(value) {
|
|
38
|
+
return typeof value === 'object' && value !== null && Object.hasOwn(value, assertionReferenceIdentity);
|
|
39
|
+
}
|
|
40
|
+
export function isNarrowingAssertionReference(value) {
|
|
41
|
+
return isAssertionReference(value) && getAssertionReferenceRecord(value).kind === 'narrowing-composite';
|
|
42
|
+
}
|
|
43
|
+
export function isCompositeAssertionGroup(value) {
|
|
44
|
+
return typeof value === 'object' && value !== null && Object.hasOwn(value, compositeGroupIdentity);
|
|
45
|
+
}
|
|
46
|
+
export function createCompositeAssertionGroup(children) {
|
|
47
|
+
return { [compositeGroupIdentity]: true, children };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=assertion-reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion-reference.js","sourceRoot":"","sources":["../../../../source/assertion-protocol/assertion-reference.ts"],"names":[],"mappings":"AASA,MAAM,0BAA0B,GAAkB,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC3F,MAAM,gCAAgC,GAAkB,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AACvG,MAAM,sBAAsB,GAAkB,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAyHnF,SAAS,mBAAmB,CAAC,IAAY;IACrC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAC;IACvE,CAAC;AACL,CAAC;AAaD,MAAM,UAAU,8BAA8B,CAAC,MAAgC;IAC3E,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO;YACH,CAAC,0BAA0B,CAAC,EAAE,IAAI;YAClC,CAAC,gCAAgC,CAAC,EAAE,MAAM;S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AC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { ActualAssertionNode, AssertionSource } from '../assertion-node-shape.ts';
|
|
3
|
+
export type TrueAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'true'>;
|
|
4
|
+
export type FalseAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'false'>;
|
|
5
|
+
export declare const booleanSummaryByCheck: {
|
|
6
|
+
readonly false: "Expected value to be false.";
|
|
7
|
+
readonly true: "Expected value to be true.";
|
|
8
|
+
};
|
|
9
|
+
export declare function evaluateFalse(assertion: FalseAssertionNode): AssertionOutcome;
|
|
10
|
+
export declare function evaluateTrue(assertion: TrueAssertionNode): AssertionOutcome;
|
|
11
|
+
//# sourceMappingURL=boolean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEvF,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtH,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExH,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAEX,wBAAgB,aAAa,CAAC,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAE7E;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAE3E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { ActualAssertionNode, AssertionSource, ResolvableSourceLocation } from '../assertion-node-shape.ts';
|
|
3
|
+
export type LengthAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
4
|
+
readonly actual: unknown;
|
|
5
|
+
readonly check: 'length';
|
|
6
|
+
readonly expectedLength: number;
|
|
7
|
+
readonly location: ResolvableSourceLocation;
|
|
8
|
+
readonly message: string | null;
|
|
9
|
+
readonly source: Source;
|
|
10
|
+
};
|
|
11
|
+
export type EmptinessAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
12
|
+
readonly [Check in 'empty' | 'not-empty']: ActualAssertionNode<Source, Check>;
|
|
13
|
+
}['empty' | 'not-empty'];
|
|
14
|
+
export declare const collectionSummaryByCheck: {
|
|
15
|
+
readonly empty: "Expected collection to be empty.";
|
|
16
|
+
readonly length: "Expected collection length to match.";
|
|
17
|
+
readonly 'not-empty': "Expected collection not to be empty.";
|
|
18
|
+
};
|
|
19
|
+
export declare function evaluateEmpty(assertion: EmptinessAssertionNode): AssertionOutcome;
|
|
20
|
+
export declare function evaluateLength(assertion: LengthAssertionNode): AssertionOutcome;
|
|
21
|
+
export declare function evaluateNotEmpty(assertion: EmptinessAssertionNode): AssertionOutcome;
|
|
22
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGjH,MAAM,MAAM,mBAAmB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IAChF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IACnF,QAAQ,EAAE,KAAK,IAAI,OAAO,GAAG,WAAW,GAAG,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC;CAChF,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;AAEzB,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX,wBAAgB,aAAa,CAAC,SAAS,EAAE,sBAAsB,GAAG,gBAAgB,CAQjF;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,mBAAmB,GAAG,gBAAgB,CAS/E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,sBAAsB,GAAG,gBAAgB,CAQpF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { AssertionSource, ExpectedAssertionNode } from '../assertion-node-shape.ts';
|
|
3
|
+
export type EqualAssertionNode<Source extends AssertionSource = AssertionSource> = ExpectedAssertionNode<Source, 'equal'>;
|
|
4
|
+
export type NotEqualAssertionNode<Source extends AssertionSource = AssertionSource> = ExpectedAssertionNode<Source, 'not-equal'>;
|
|
5
|
+
export type DeepEqualAssertionNode<Source extends AssertionSource = AssertionSource> = ExpectedAssertionNode<Source, 'deep-equal'>;
|
|
6
|
+
export type NotDeepEqualAssertionNode<Source extends AssertionSource = AssertionSource> = ExpectedAssertionNode<Source, 'not-deep-equal'>;
|
|
7
|
+
export declare const equalitySummaryByCheck: {
|
|
8
|
+
readonly 'deep-equal': "Expected values to be deeply equal.";
|
|
9
|
+
readonly equal: "Expected values to be equal.";
|
|
10
|
+
readonly 'not-deep-equal': "Expected values not to be deeply equal.";
|
|
11
|
+
readonly 'not-equal': "Expected values not to be equal.";
|
|
12
|
+
};
|
|
13
|
+
export declare function evaluateDeepEqual(assertion: DeepEqualAssertionNode): AssertionOutcome;
|
|
14
|
+
export declare function evaluateEqual(assertion: EqualAssertionNode): AssertionOutcome;
|
|
15
|
+
export declare function evaluateNotDeepEqual(assertion: NotDeepEqualAssertionNode): AssertionOutcome;
|
|
16
|
+
export declare function evaluateNotEqual(assertion: NotEqualAssertionNode): AssertionOutcome;
|
|
17
|
+
//# sourceMappingURL=equality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equality.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/equality.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuC,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEzF,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,qBAAqB,CACpG,MAAM,EACN,OAAO,CACV,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,qBAAqB,CACvG,MAAM,EACN,WAAW,CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,qBAAqB,CACxG,MAAM,EACN,YAAY,CACf,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,qBAAqB,CAC3G,MAAM,EACN,gBAAgB,CACnB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,sBAAsB,GAAG,gBAAgB,CAErF;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAM7E;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,yBAAyB,GAAG,gBAAgB,CAM3F;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,qBAAqB,GAAG,gBAAgB,CAEnF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { AssertionSource, ResolvableSourceLocation } from '../assertion-node-shape.ts';
|
|
3
|
+
export type FailAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
4
|
+
readonly check: 'fail';
|
|
5
|
+
readonly location: ResolvableSourceLocation;
|
|
6
|
+
readonly message: string | null;
|
|
7
|
+
readonly source: Source;
|
|
8
|
+
};
|
|
9
|
+
export declare const failSummaryByCheck: {
|
|
10
|
+
readonly fail: "Assertion failed.";
|
|
11
|
+
};
|
|
12
|
+
export declare function evaluateFail(assertion: FailAssertionNode): AssertionOutcome;
|
|
13
|
+
//# sourceMappingURL=fail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fail.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/fail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE5F,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;CAErB,CAAC;AAEX,wBAAgB,YAAY,CAAC,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAE3E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { AssertionSource, ExpectedAssertionNode, ResolvableSourceLocation } from '../assertion-node-shape.ts';
|
|
3
|
+
type NumericComparisonCheck = 'greater-than' | 'greater-than-or-equal' | 'less-than' | 'less-than-or-equal';
|
|
4
|
+
export type NumericComparisonAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
5
|
+
readonly [Check in NumericComparisonCheck]: ExpectedAssertionNode<Source, Check>;
|
|
6
|
+
}[NumericComparisonCheck];
|
|
7
|
+
export type BetweenAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
8
|
+
readonly actual: unknown;
|
|
9
|
+
readonly check: 'between';
|
|
10
|
+
readonly location: ResolvableSourceLocation;
|
|
11
|
+
readonly maximum: number;
|
|
12
|
+
readonly message: string | null;
|
|
13
|
+
readonly minimum: number;
|
|
14
|
+
readonly source: Source;
|
|
15
|
+
};
|
|
16
|
+
export declare const numericSummaryByCheck: {
|
|
17
|
+
readonly between: "Expected number to be between the bounds.";
|
|
18
|
+
readonly 'greater-than': "Expected number to be greater than the threshold.";
|
|
19
|
+
readonly 'greater-than-or-equal': "Expected number to be greater than or equal to the threshold.";
|
|
20
|
+
readonly 'less-than': "Expected number to be less than the threshold.";
|
|
21
|
+
readonly 'less-than-or-equal': "Expected number to be less than or equal to the threshold.";
|
|
22
|
+
};
|
|
23
|
+
export declare function evaluateBetween(assertion: BetweenAssertionNode): AssertionOutcome;
|
|
24
|
+
export declare function evaluateGreaterThan(assertion: NumericComparisonAssertionNode): AssertionOutcome;
|
|
25
|
+
export declare function evaluateGreaterThanOrEqual(assertion: NumericComparisonAssertionNode): AssertionOutcome;
|
|
26
|
+
export declare function evaluateLessThan(assertion: NumericComparisonAssertionNode): AssertionOutcome;
|
|
27
|
+
export declare function evaluateLessThanOrEqual(assertion: NumericComparisonAssertionNode): AssertionOutcome;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=numeric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/numeric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEnH,KAAK,sBAAsB,GAAG,cAAc,GAAG,uBAAuB,GAAG,WAAW,GAAG,oBAAoB,CAAC;AAE5G,MAAM,MAAM,8BAA8B,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IAC3F,QAAQ,EAAE,KAAK,IAAI,sBAAsB,GAAG,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC;CACnF,CAAC,sBAAsB,CAAC,CAAC;AAE1B,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IACjF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;CAMxB,CAAC;AAMX,wBAAgB,eAAe,CAAC,SAAS,EAAE,oBAAoB,GAAG,gBAAgB,CAOjF;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,8BAA8B,GAAG,gBAAgB,CAM/F;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,8BAA8B,GAAG,gBAAgB,CAMtG;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,8BAA8B,GAAG,gBAAgB,CAM5F;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,8BAA8B,GAAG,gBAAgB,CAMnG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { AssertionSource, ExpectedAssertionNode } from '../assertion-node-shape.ts';
|
|
3
|
+
export type PartialDeepEqualAssertionNode<Source extends AssertionSource = AssertionSource> = ExpectedAssertionNode<Source, 'partial-deep-equal'>;
|
|
4
|
+
export type ArrayContainsPartialAssertionNode<Source extends AssertionSource = AssertionSource> = ExpectedAssertionNode<Source, 'array-contains-partial'>;
|
|
5
|
+
export type MembersPartialDeepEqualAssertionNode<Source extends AssertionSource = AssertionSource> = ExpectedAssertionNode<Source, 'members-partial-deep-equal'>;
|
|
6
|
+
export declare const partialSummaryByCheck: {
|
|
7
|
+
readonly 'array-contains-partial': "Expected array to contain a partial member.";
|
|
8
|
+
readonly 'members-partial-deep-equal': "Expected array to contain the partial members.";
|
|
9
|
+
readonly 'partial-deep-equal': "Expected value to partially match.";
|
|
10
|
+
};
|
|
11
|
+
export declare function evaluateArrayContainsPartial(assertion: ArrayContainsPartialAssertionNode): AssertionOutcome;
|
|
12
|
+
export declare function evaluateMembersPartialDeepEqual(assertion: MembersPartialDeepEqualAssertionNode): AssertionOutcome;
|
|
13
|
+
export declare function evaluatePartialDeepEqual(assertion: PartialDeepEqualAssertionNode): AssertionOutcome;
|
|
14
|
+
//# sourceMappingURL=partial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partial.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/partial.ts"],"names":[],"mappings":"AAKA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEzF,MAAM,MAAM,6BAA6B,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,qBAAqB,CAC/G,MAAM,EACN,oBAAoB,CACvB,CAAC;AAEF,MAAM,MAAM,iCAAiC,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,qBAAqB,CACnH,MAAM,EACN,wBAAwB,CAC3B,CAAC;AAEF,MAAM,MAAM,oCAAoC,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAC7F,qBAAqB,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,iCAAiC,GAAG,gBAAgB,CAE3G;AAED,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,oCAAoC,GAAG,gBAAgB,CAEjH;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,6BAA6B,GAAG,gBAAgB,CAEnG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { ActualAssertionNode, AssertionSource } from '../assertion-node-shape.ts';
|
|
3
|
+
export type DefinedAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'defined'>;
|
|
4
|
+
export type NullAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'null'>;
|
|
5
|
+
export type NotNullAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'not-null'>;
|
|
6
|
+
export type UndefinedAssertionNode<Source extends AssertionSource = AssertionSource> = ActualAssertionNode<Source, 'undefined'>;
|
|
7
|
+
export declare const presenceSummaryByCheck: {
|
|
8
|
+
readonly defined: "Expected value to be defined.";
|
|
9
|
+
readonly 'not-null': "Expected value not to be null.";
|
|
10
|
+
readonly null: "Expected value to be null.";
|
|
11
|
+
readonly undefined: "Expected value to be undefined.";
|
|
12
|
+
};
|
|
13
|
+
export declare function evaluateDefined(assertion: DefinedAssertionNode): AssertionOutcome;
|
|
14
|
+
export declare function evaluateNotNull(assertion: NotNullAssertionNode): AssertionOutcome;
|
|
15
|
+
export declare function evaluateNull(assertion: NullAssertionNode): AssertionOutcome;
|
|
16
|
+
export declare function evaluateUndefined(assertion: UndefinedAssertionNode): AssertionOutcome;
|
|
17
|
+
//# sourceMappingURL=presence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presence.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/presence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEvF,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CACpG,MAAM,EACN,SAAS,CACZ,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtH,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CACpG,MAAM,EACN,UAAU,CACb,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI,mBAAmB,CACtG,MAAM,EACN,WAAW,CACd,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX,wBAAgB,eAAe,CAAC,SAAS,EAAE,oBAAoB,GAAG,gBAAgB,CAMjF;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,oBAAoB,GAAG,gBAAgB,CAEjF;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAE3E;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,sBAAsB,GAAG,gBAAgB,CAErF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { AssertionSource, ExpectedAssertionNode, ResolvableSourceLocation } from '../assertion-node-shape.ts';
|
|
3
|
+
export type MatchAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
4
|
+
readonly [Check in 'match' | 'not-match']: {
|
|
5
|
+
readonly actual: unknown;
|
|
6
|
+
readonly check: Check;
|
|
7
|
+
readonly location: ResolvableSourceLocation;
|
|
8
|
+
readonly message: string | null;
|
|
9
|
+
readonly pattern: RegExp;
|
|
10
|
+
readonly source: Source;
|
|
11
|
+
};
|
|
12
|
+
}['match' | 'not-match'];
|
|
13
|
+
export type StringContainsAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
14
|
+
readonly [Check in 'ends-with' | 'includes' | 'starts-with']: ExpectedAssertionNode<Source, Check>;
|
|
15
|
+
}['ends-with' | 'includes' | 'starts-with'];
|
|
16
|
+
export declare const stringSummaryByCheck: {
|
|
17
|
+
readonly 'ends-with': "Expected string to end with the value.";
|
|
18
|
+
readonly includes: "Expected string to include the value.";
|
|
19
|
+
readonly match: "Expected string to match the pattern.";
|
|
20
|
+
readonly 'not-match': "Expected string not to match the pattern.";
|
|
21
|
+
readonly 'starts-with': "Expected string to start with the value.";
|
|
22
|
+
};
|
|
23
|
+
export declare function evaluateEndsWith(assertion: StringContainsAssertionNode): AssertionOutcome;
|
|
24
|
+
export declare function evaluateIncludes(assertion: StringContainsAssertionNode): AssertionOutcome;
|
|
25
|
+
export declare function evaluateMatch(assertion: MatchAssertionNode): AssertionOutcome;
|
|
26
|
+
export declare function evaluateNotMatch(assertion: MatchAssertionNode): AssertionOutcome;
|
|
27
|
+
export declare function evaluateStartsWith(assertion: StringContainsAssertionNode): AssertionOutcome;
|
|
28
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEnH,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IAC/E,QAAQ,EAAE,KAAK,IAAI,OAAO,GAAG,WAAW,GAAG;QACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;QACtB,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;QAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KAC3B;CACJ,CAAC,OAAO,GAAG,WAAW,CAAC,CAAC;AAEzB,MAAM,MAAM,2BAA2B,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IACxF,QAAQ,EAAE,KAAK,IAAI,WAAW,GAAG,UAAU,GAAG,aAAa,GAAG,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC;CACrG,CAAC,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC,CAAC;AAE5C,eAAO,MAAM,oBAAoB;;;;;;CAMvB,CAAC;AAEX,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,2BAA2B,GAAG,gBAAgB,CAMzF;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,2BAA2B,GAAG,gBAAgB,CAMzF;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAM7E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAMhF;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,2BAA2B,GAAG,gBAAgB,CAM3F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type AssertionOutcome } from '../assertion-evaluation.ts';
|
|
2
|
+
import type { ActualAssertionNode, AssertionSource, InstanceConstructor, ResolvableSourceLocation } from '../assertion-node-shape.ts';
|
|
3
|
+
type TypeAssertionCheck = 'array' | 'boolean' | 'function' | 'number' | 'object' | 'string';
|
|
4
|
+
export type TypeAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
5
|
+
readonly [Check in TypeAssertionCheck]: ActualAssertionNode<Source, Check>;
|
|
6
|
+
}[TypeAssertionCheck];
|
|
7
|
+
export type InstanceOfAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
8
|
+
readonly actual: unknown;
|
|
9
|
+
readonly check: 'instance-of';
|
|
10
|
+
readonly expected: InstanceConstructor;
|
|
11
|
+
readonly location: ResolvableSourceLocation;
|
|
12
|
+
readonly message: string | null;
|
|
13
|
+
readonly source: Source;
|
|
14
|
+
};
|
|
15
|
+
export type HasPropertyAssertionNode<Source extends AssertionSource = AssertionSource> = {
|
|
16
|
+
readonly actual: unknown;
|
|
17
|
+
readonly check: 'has-property';
|
|
18
|
+
readonly key: PropertyKey;
|
|
19
|
+
readonly location: ResolvableSourceLocation;
|
|
20
|
+
readonly message: string | null;
|
|
21
|
+
readonly source: Source;
|
|
22
|
+
};
|
|
23
|
+
export declare const typeShapeSummaryByCheck: {
|
|
24
|
+
readonly array: "Expected value to be an array.";
|
|
25
|
+
readonly boolean: "Expected value to be a boolean.";
|
|
26
|
+
readonly function: "Expected value to be a function.";
|
|
27
|
+
readonly 'has-property': "Expected object to have the own property.";
|
|
28
|
+
readonly 'instance-of': "Expected value to be an instance of the constructor.";
|
|
29
|
+
readonly number: "Expected value to be a number.";
|
|
30
|
+
readonly object: "Expected value to be an object.";
|
|
31
|
+
readonly string: "Expected value to be a string.";
|
|
32
|
+
};
|
|
33
|
+
export declare function evaluateArray(assertion: TypeAssertionNode): AssertionOutcome;
|
|
34
|
+
export declare function evaluateBoolean(assertion: TypeAssertionNode): AssertionOutcome;
|
|
35
|
+
export declare function evaluateFunction(assertion: TypeAssertionNode): AssertionOutcome;
|
|
36
|
+
export declare function evaluateHasProperty(assertion: HasPropertyAssertionNode): AssertionOutcome;
|
|
37
|
+
export declare function evaluateInstanceOf(assertion: InstanceOfAssertionNode): AssertionOutcome;
|
|
38
|
+
export declare function evaluateNumber(assertion: TypeAssertionNode): AssertionOutcome;
|
|
39
|
+
export declare function evaluateObject(assertion: TypeAssertionNode): AssertionOutcome;
|
|
40
|
+
export declare function evaluateString(assertion: TypeAssertionNode): AssertionOutcome;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=type-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-shape.d.ts","sourceRoot":"","sources":["../../../../../source/assertion-protocol/assertions/type-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EACR,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EAC3B,MAAM,4BAA4B,CAAC;AAGpC,KAAK,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5F,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe,IAAI;IAC9E,QAAQ,EAAE,KAAK,IAAI,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC;CAC7E,CAAC,kBAAkB,CAAC,CAAC;AAEtB,MAAM,MAAM,uBAA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AED,wBAAgB,cAAc,CAAC,SAAS,EAAE,iBAAiB,GAAG,gBAAgB,CAE7E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ThrownErrorRecord = {
|
|
2
|
+
readonly message: string;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly stack: string | null;
|
|
5
|
+
readonly thrown: unknown;
|
|
6
|
+
};
|
|
7
|
+
export declare function createThrownErrorRecord(thrown: unknown): ThrownErrorRecord;
|
|
8
|
+
//# sourceMappingURL=thrown-error-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thrown-error-record.d.ts","sourceRoot":"","sources":["../../../../source/assertion-protocol/thrown-error-record.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,CAgB1E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function createThrownErrorRecord(thrown) {
|
|
2
|
+
if (thrown instanceof Error) {
|
|
3
|
+
return {
|
|
4
|
+
message: thrown.message,
|
|
5
|
+
name: thrown.name,
|
|
6
|
+
stack: thrown.stack ?? null,
|
|
7
|
+
thrown
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
message: 'Test body threw a non-error value.',
|
|
12
|
+
name: typeof thrown,
|
|
13
|
+
stack: null,
|
|
14
|
+
thrown
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=thrown-error-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thrown-error-record.js","sourceRoot":"","sources":["../../../../source/assertion-protocol/thrown-error-record.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,uBAAuB,CAAC,MAAe;IACnD,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;QAC1B,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI;YAC3B,MAAM;SACT,CAAC;IACN,CAAC;IAED,OAAO;QACH,OAAO,EAAE,oCAAoC;QAC7C,IAAI,EAAE,OAAO,MAAM;QACnB,KAAK,EAAE,IAAI;QACX,MAAM;KACT,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CompositeAssertionChildNode, CompositeAssertionNode } from './assertion-node.ts';
|
|
2
|
+
import type { AssertionSource, InstanceConstructor, NonEmptyReadonlyArray, ResolvableSourceLocation } from './assertion-node-shape.ts';
|
|
3
|
+
type OptionalFields<Shape, RequiredKey extends keyof Shape> = {
|
|
4
|
+
readonly [ShapeKey in keyof Shape as ShapeKey extends RequiredKey ? never : ShapeKey]?: Shape[ShapeKey];
|
|
5
|
+
};
|
|
6
|
+
type RequiredField<Shape, RequiredKey extends keyof Shape> = {
|
|
7
|
+
readonly [ShapeKey in RequiredKey]-?: Shape[ShapeKey];
|
|
8
|
+
};
|
|
9
|
+
type RequireAtLeastOne<Shape, Key extends keyof Shape = keyof Shape> = {
|
|
10
|
+
readonly [RequiredKey in Key]: OptionalFields<Shape, RequiredKey> & RequiredField<Shape, RequiredKey>;
|
|
11
|
+
}[Key];
|
|
12
|
+
type ErrorConstructor = InstanceConstructor & (abstract new (...args: never[]) => Error);
|
|
13
|
+
type ErrorMatcherFields = {
|
|
14
|
+
readonly cause: ThrownMatcher;
|
|
15
|
+
readonly code: string;
|
|
16
|
+
readonly message: RegExp | string;
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly type: ErrorConstructor;
|
|
19
|
+
};
|
|
20
|
+
export type ExactThrownMatcher = {
|
|
21
|
+
readonly cause?: never;
|
|
22
|
+
readonly code?: never;
|
|
23
|
+
readonly exact: unknown;
|
|
24
|
+
readonly message?: never;
|
|
25
|
+
readonly name?: never;
|
|
26
|
+
readonly type?: never;
|
|
27
|
+
};
|
|
28
|
+
export type ErrorMatcher = RequireAtLeastOne<ErrorMatcherFields> & {
|
|
29
|
+
readonly exact?: never;
|
|
30
|
+
};
|
|
31
|
+
export type ThrownMatcher = ErrorMatcher | ExactThrownMatcher;
|
|
32
|
+
type NonPromise<Body extends () => unknown> = ReturnType<Body> extends PromiseLike<unknown> ? never : Body;
|
|
33
|
+
export type SynchronousCallback<Body extends () => unknown> = [ReturnType<Body>] extends [never] ? Body : NonPromise<Body>;
|
|
34
|
+
type ThrownAssertionKind = 'rejects' | 'throws';
|
|
35
|
+
type ObservationStatus = 'rejected' | 'resolved' | 'returned' | 'threw';
|
|
36
|
+
export type ThrownAssertionObservation = {
|
|
37
|
+
readonly status: ObservationStatus;
|
|
38
|
+
readonly value: unknown;
|
|
39
|
+
};
|
|
40
|
+
type ThrownAssertionInput<Source extends AssertionSource> = {
|
|
41
|
+
readonly kind: ThrownAssertionKind;
|
|
42
|
+
readonly location: ResolvableSourceLocation;
|
|
43
|
+
readonly matcher: ThrownMatcher;
|
|
44
|
+
readonly message: string | null;
|
|
45
|
+
readonly observation: ThrownAssertionObservation;
|
|
46
|
+
readonly source: Source;
|
|
47
|
+
};
|
|
48
|
+
export declare function thrownMatcherChildren<Source extends AssertionSource>(input: ThrownAssertionInput<Source>): NonEmptyReadonlyArray<CompositeAssertionChildNode<Source>>;
|
|
49
|
+
export declare function createThrownMatcherAssertion<Source extends AssertionSource>(input: ThrownAssertionInput<Source>): CompositeAssertionNode<Source>;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=thrown-matcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thrown-matcher.d.ts","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