bupkis 0.18.0 → 0.18.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/CHANGELOG.md +14 -0
- package/package.json +1 -4
- package/src/assertion/assertion-types.ts +4 -4
- package/src/assertion/impl/async-parametric.ts +4 -21
- package/src/assertion/impl/sync-parametric.ts +5 -17
- package/src/expect.ts +0 -4
- package/src/guards.ts +24 -24
- package/src/internal-schema.ts +16 -32
- package/src/value-to-schema.ts +1 -1
- package/dist/assertion/assertion-async.cjs +0 -268
- package/dist/assertion/assertion-async.cjs.map +0 -1
- package/dist/assertion/assertion-async.d.cts +0 -40
- package/dist/assertion/assertion-async.d.cts.map +0 -1
- package/dist/assertion/assertion-async.d.ts +0 -40
- package/dist/assertion/assertion-async.d.ts.map +0 -1
- package/dist/assertion/assertion-async.js +0 -259
- package/dist/assertion/assertion-async.js.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.cjs +0 -132
- package/dist/assertion/assertion-standard-schema-async.cjs.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.d.cts +0 -52
- package/dist/assertion/assertion-standard-schema-async.d.cts.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.d.ts +0 -52
- package/dist/assertion/assertion-standard-schema-async.d.ts.map +0 -1
- package/dist/assertion/assertion-standard-schema-async.js +0 -128
- package/dist/assertion/assertion-standard-schema-async.js.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.cjs +0 -141
- package/dist/assertion/assertion-standard-schema-sync.cjs.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.d.cts +0 -52
- package/dist/assertion/assertion-standard-schema-sync.d.cts.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.d.ts +0 -52
- package/dist/assertion/assertion-standard-schema-sync.d.ts.map +0 -1
- package/dist/assertion/assertion-standard-schema-sync.js +0 -137
- package/dist/assertion/assertion-standard-schema-sync.js.map +0 -1
- package/dist/assertion/assertion-sync.cjs +0 -284
- package/dist/assertion/assertion-sync.cjs.map +0 -1
- package/dist/assertion/assertion-sync.d.cts +0 -60
- package/dist/assertion/assertion-sync.d.cts.map +0 -1
- package/dist/assertion/assertion-sync.d.ts +0 -60
- package/dist/assertion/assertion-sync.d.ts.map +0 -1
- package/dist/assertion/assertion-sync.js +0 -275
- package/dist/assertion/assertion-sync.js.map +0 -1
- package/dist/assertion/assertion-types.cjs +0 -20
- package/dist/assertion/assertion-types.cjs.map +0 -1
- package/dist/assertion/assertion-types.d.cts +0 -1086
- package/dist/assertion/assertion-types.d.cts.map +0 -1
- package/dist/assertion/assertion-types.d.ts +0 -1086
- package/dist/assertion/assertion-types.d.ts.map +0 -1
- package/dist/assertion/assertion-types.js +0 -19
- package/dist/assertion/assertion-types.js.map +0 -1
- package/dist/assertion/assertion.cjs +0 -382
- package/dist/assertion/assertion.cjs.map +0 -1
- package/dist/assertion/assertion.d.cts +0 -109
- package/dist/assertion/assertion.d.cts.map +0 -1
- package/dist/assertion/assertion.d.ts +0 -109
- package/dist/assertion/assertion.d.ts.map +0 -1
- package/dist/assertion/assertion.js +0 -375
- package/dist/assertion/assertion.js.map +0 -1
- package/dist/assertion/create.cjs +0 -148
- package/dist/assertion/create.cjs.map +0 -1
- package/dist/assertion/create.d.cts +0 -85
- package/dist/assertion/create.d.cts.map +0 -1
- package/dist/assertion/create.d.ts +0 -85
- package/dist/assertion/create.d.ts.map +0 -1
- package/dist/assertion/create.js +0 -143
- package/dist/assertion/create.js.map +0 -1
- package/dist/assertion/format-assertion-failure.cjs +0 -63
- package/dist/assertion/format-assertion-failure.cjs.map +0 -1
- package/dist/assertion/format-assertion-failure.d.cts +0 -21
- package/dist/assertion/format-assertion-failure.d.cts.map +0 -1
- package/dist/assertion/format-assertion-failure.d.ts +0 -21
- package/dist/assertion/format-assertion-failure.d.ts.map +0 -1
- package/dist/assertion/format-assertion-failure.js +0 -59
- package/dist/assertion/format-assertion-failure.js.map +0 -1
- package/dist/assertion/impl/assertion-util.cjs +0 -68
- package/dist/assertion/impl/assertion-util.cjs.map +0 -1
- package/dist/assertion/impl/assertion-util.d.cts +0 -36
- package/dist/assertion/impl/assertion-util.d.cts.map +0 -1
- package/dist/assertion/impl/assertion-util.d.ts +0 -36
- package/dist/assertion/impl/assertion-util.d.ts.map +0 -1
- package/dist/assertion/impl/assertion-util.js +0 -62
- package/dist/assertion/impl/assertion-util.js.map +0 -1
- package/dist/assertion/impl/async-iterable.cjs +0 -627
- package/dist/assertion/impl/async-iterable.cjs.map +0 -1
- package/dist/assertion/impl/async-iterable.d.cts +0 -406
- package/dist/assertion/impl/async-iterable.d.cts.map +0 -1
- package/dist/assertion/impl/async-iterable.d.ts +0 -406
- package/dist/assertion/impl/async-iterable.d.ts.map +0 -1
- package/dist/assertion/impl/async-iterable.js +0 -624
- package/dist/assertion/impl/async-iterable.js.map +0 -1
- package/dist/assertion/impl/async-parametric.cjs +0 -423
- package/dist/assertion/impl/async-parametric.cjs.map +0 -1
- package/dist/assertion/impl/async-parametric.d.cts +0 -278
- package/dist/assertion/impl/async-parametric.d.cts.map +0 -1
- package/dist/assertion/impl/async-parametric.d.ts +0 -278
- package/dist/assertion/impl/async-parametric.d.ts.map +0 -1
- package/dist/assertion/impl/async-parametric.js +0 -420
- package/dist/assertion/impl/async-parametric.js.map +0 -1
- package/dist/assertion/impl/async.cjs +0 -56
- package/dist/assertion/impl/async.cjs.map +0 -1
- package/dist/assertion/impl/async.d.cts +0 -179
- package/dist/assertion/impl/async.d.cts.map +0 -1
- package/dist/assertion/impl/async.d.ts +0 -179
- package/dist/assertion/impl/async.d.ts.map +0 -1
- package/dist/assertion/impl/async.js +0 -39
- package/dist/assertion/impl/async.js.map +0 -1
- package/dist/assertion/impl/index.cjs +0 -37
- package/dist/assertion/impl/index.cjs.map +0 -1
- package/dist/assertion/impl/index.d.cts +0 -21
- package/dist/assertion/impl/index.d.cts.map +0 -1
- package/dist/assertion/impl/index.d.ts +0 -21
- package/dist/assertion/impl/index.d.ts.map +0 -1
- package/dist/assertion/impl/index.js +0 -21
- package/dist/assertion/impl/index.js.map +0 -1
- package/dist/assertion/impl/iteration-util.cjs +0 -297
- package/dist/assertion/impl/iteration-util.cjs.map +0 -1
- package/dist/assertion/impl/iteration-util.d.cts +0 -12
- package/dist/assertion/impl/iteration-util.d.cts.map +0 -1
- package/dist/assertion/impl/iteration-util.d.ts +0 -12
- package/dist/assertion/impl/iteration-util.d.ts.map +0 -1
- package/dist/assertion/impl/iteration-util.js +0 -282
- package/dist/assertion/impl/iteration-util.js.map +0 -1
- package/dist/assertion/impl/snapshot.cjs +0 -276
- package/dist/assertion/impl/snapshot.cjs.map +0 -1
- package/dist/assertion/impl/snapshot.d.cts +0 -278
- package/dist/assertion/impl/snapshot.d.cts.map +0 -1
- package/dist/assertion/impl/snapshot.d.ts +0 -278
- package/dist/assertion/impl/snapshot.d.ts.map +0 -1
- package/dist/assertion/impl/snapshot.js +0 -273
- package/dist/assertion/impl/snapshot.js.map +0 -1
- package/dist/assertion/impl/sync-basic.cjs +0 -553
- package/dist/assertion/impl/sync-basic.cjs.map +0 -1
- package/dist/assertion/impl/sync-basic.d.cts +0 -528
- package/dist/assertion/impl/sync-basic.d.cts.map +0 -1
- package/dist/assertion/impl/sync-basic.d.ts +0 -528
- package/dist/assertion/impl/sync-basic.d.ts.map +0 -1
- package/dist/assertion/impl/sync-basic.js +0 -550
- package/dist/assertion/impl/sync-basic.js.map +0 -1
- package/dist/assertion/impl/sync-collection.cjs +0 -856
- package/dist/assertion/impl/sync-collection.cjs.map +0 -1
- package/dist/assertion/impl/sync-collection.d.cts +0 -607
- package/dist/assertion/impl/sync-collection.d.cts.map +0 -1
- package/dist/assertion/impl/sync-collection.d.ts +0 -607
- package/dist/assertion/impl/sync-collection.d.ts.map +0 -1
- package/dist/assertion/impl/sync-collection.js +0 -850
- package/dist/assertion/impl/sync-collection.js.map +0 -1
- package/dist/assertion/impl/sync-date.cjs +0 -341
- package/dist/assertion/impl/sync-date.cjs.map +0 -1
- package/dist/assertion/impl/sync-date.d.cts +0 -209
- package/dist/assertion/impl/sync-date.d.cts.map +0 -1
- package/dist/assertion/impl/sync-date.d.ts +0 -209
- package/dist/assertion/impl/sync-date.d.ts.map +0 -1
- package/dist/assertion/impl/sync-date.js +0 -338
- package/dist/assertion/impl/sync-date.js.map +0 -1
- package/dist/assertion/impl/sync-esoteric.cjs +0 -214
- package/dist/assertion/impl/sync-esoteric.cjs.map +0 -1
- package/dist/assertion/impl/sync-esoteric.d.cts +0 -191
- package/dist/assertion/impl/sync-esoteric.d.cts.map +0 -1
- package/dist/assertion/impl/sync-esoteric.d.ts +0 -191
- package/dist/assertion/impl/sync-esoteric.d.ts.map +0 -1
- package/dist/assertion/impl/sync-esoteric.js +0 -211
- package/dist/assertion/impl/sync-esoteric.js.map +0 -1
- package/dist/assertion/impl/sync-iterable.cjs +0 -512
- package/dist/assertion/impl/sync-iterable.cjs.map +0 -1
- package/dist/assertion/impl/sync-iterable.d.cts +0 -334
- package/dist/assertion/impl/sync-iterable.d.cts.map +0 -1
- package/dist/assertion/impl/sync-iterable.d.ts +0 -334
- package/dist/assertion/impl/sync-iterable.d.ts.map +0 -1
- package/dist/assertion/impl/sync-iterable.js +0 -509
- package/dist/assertion/impl/sync-iterable.js.map +0 -1
- package/dist/assertion/impl/sync-parametric.cjs +0 -812
- package/dist/assertion/impl/sync-parametric.cjs.map +0 -1
- package/dist/assertion/impl/sync-parametric.d.cts +0 -560
- package/dist/assertion/impl/sync-parametric.d.cts.map +0 -1
- package/dist/assertion/impl/sync-parametric.d.ts +0 -560
- package/dist/assertion/impl/sync-parametric.d.ts.map +0 -1
- package/dist/assertion/impl/sync-parametric.js +0 -809
- package/dist/assertion/impl/sync-parametric.js.map +0 -1
- package/dist/assertion/impl/sync.cjs +0 -214
- package/dist/assertion/impl/sync.cjs.map +0 -1
- package/dist/assertion/impl/sync.d.cts +0 -512
- package/dist/assertion/impl/sync.d.cts.map +0 -1
- package/dist/assertion/impl/sync.d.ts +0 -512
- package/dist/assertion/impl/sync.d.ts.map +0 -1
- package/dist/assertion/impl/sync.js +0 -197
- package/dist/assertion/impl/sync.js.map +0 -1
- package/dist/assertion/index.cjs +0 -38
- package/dist/assertion/index.cjs.map +0 -1
- package/dist/assertion/index.d.cts +0 -18
- package/dist/assertion/index.d.cts.map +0 -1
- package/dist/assertion/index.d.ts +0 -18
- package/dist/assertion/index.d.ts.map +0 -1
- package/dist/assertion/index.js +0 -17
- package/dist/assertion/index.js.map +0 -1
- package/dist/assertion/slotify.cjs +0 -165
- package/dist/assertion/slotify.cjs.map +0 -1
- package/dist/assertion/slotify.d.cts +0 -11
- package/dist/assertion/slotify.d.cts.map +0 -1
- package/dist/assertion/slotify.d.ts +0 -11
- package/dist/assertion/slotify.d.ts.map +0 -1
- package/dist/assertion/slotify.js +0 -161
- package/dist/assertion/slotify.js.map +0 -1
- package/dist/bootstrap.cjs +0 -43
- package/dist/bootstrap.cjs.map +0 -1
- package/dist/bootstrap.d.cts +0 -27
- package/dist/bootstrap.d.cts.map +0 -1
- package/dist/bootstrap.d.ts +0 -27
- package/dist/bootstrap.d.ts.map +0 -1
- package/dist/bootstrap.js +0 -40
- package/dist/bootstrap.js.map +0 -1
- package/dist/constant.cjs +0 -82
- package/dist/constant.cjs.map +0 -1
- package/dist/constant.d.cts +0 -69
- package/dist/constant.d.cts.map +0 -1
- package/dist/constant.d.ts +0 -69
- package/dist/constant.d.ts.map +0 -1
- package/dist/constant.js +0 -79
- package/dist/constant.js.map +0 -1
- package/dist/diff.cjs +0 -340
- package/dist/diff.cjs.map +0 -1
- package/dist/diff.d.cts +0 -51
- package/dist/diff.d.cts.map +0 -1
- package/dist/diff.d.ts +0 -51
- package/dist/diff.d.ts.map +0 -1
- package/dist/diff.js +0 -334
- package/dist/diff.js.map +0 -1
- package/dist/error.cjs +0 -204
- package/dist/error.cjs.map +0 -1
- package/dist/error.d.cts +0 -212
- package/dist/error.d.cts.map +0 -1
- package/dist/error.d.ts +0 -212
- package/dist/error.d.ts.map +0 -1
- package/dist/error.js +0 -191
- package/dist/error.js.map +0 -1
- package/dist/expect.cjs +0 -590
- package/dist/expect.cjs.map +0 -1
- package/dist/expect.d.cts +0 -138
- package/dist/expect.d.cts.map +0 -1
- package/dist/expect.d.ts +0 -138
- package/dist/expect.d.ts.map +0 -1
- package/dist/expect.js +0 -582
- package/dist/expect.js.map +0 -1
- package/dist/guards.cjs +0 -297
- package/dist/guards.cjs.map +0 -1
- package/dist/guards.d.cts +0 -231
- package/dist/guards.d.cts.map +0 -1
- package/dist/guards.d.ts +0 -231
- package/dist/guards.d.ts.map +0 -1
- package/dist/guards.js +0 -277
- package/dist/guards.js.map +0 -1
- package/dist/index.cjs +0 -111
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -448
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts +0 -448
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -71
- package/dist/index.js.map +0 -1
- package/dist/internal-schema.cjs +0 -253
- package/dist/internal-schema.cjs.map +0 -1
- package/dist/internal-schema.d.cts +0 -8
- package/dist/internal-schema.d.cts.map +0 -1
- package/dist/internal-schema.d.ts +0 -8
- package/dist/internal-schema.d.ts.map +0 -1
- package/dist/internal-schema.js +0 -248
- package/dist/internal-schema.js.map +0 -1
- package/dist/metadata.cjs +0 -57
- package/dist/metadata.cjs.map +0 -1
- package/dist/metadata.d.cts +0 -27
- package/dist/metadata.d.cts.map +0 -1
- package/dist/metadata.d.ts +0 -27
- package/dist/metadata.d.ts.map +0 -1
- package/dist/metadata.js +0 -54
- package/dist/metadata.js.map +0 -1
- package/dist/schema.cjs +0 -1522
- package/dist/schema.cjs.map +0 -1
- package/dist/schema.d.cts +0 -1196
- package/dist/schema.d.cts.map +0 -1
- package/dist/schema.d.ts +0 -1196
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -1516
- package/dist/schema.js.map +0 -1
- package/dist/snapshot/adapter.cjs +0 -31
- package/dist/snapshot/adapter.cjs.map +0 -1
- package/dist/snapshot/adapter.d.cts +0 -258
- package/dist/snapshot/adapter.d.cts.map +0 -1
- package/dist/snapshot/adapter.d.ts +0 -258
- package/dist/snapshot/adapter.d.ts.map +0 -1
- package/dist/snapshot/adapter.js +0 -27
- package/dist/snapshot/adapter.js.map +0 -1
- package/dist/snapshot/adapters/fallback.cjs +0 -453
- package/dist/snapshot/adapters/fallback.cjs.map +0 -1
- package/dist/snapshot/adapters/fallback.d.cts +0 -185
- package/dist/snapshot/adapters/fallback.d.cts.map +0 -1
- package/dist/snapshot/adapters/fallback.d.ts +0 -185
- package/dist/snapshot/adapters/fallback.d.ts.map +0 -1
- package/dist/snapshot/adapters/fallback.js +0 -446
- package/dist/snapshot/adapters/fallback.js.map +0 -1
- package/dist/snapshot/adapters/node-test.cjs +0 -301
- package/dist/snapshot/adapters/node-test.cjs.map +0 -1
- package/dist/snapshot/adapters/node-test.d.cts +0 -131
- package/dist/snapshot/adapters/node-test.d.cts.map +0 -1
- package/dist/snapshot/adapters/node-test.d.ts +0 -131
- package/dist/snapshot/adapters/node-test.d.ts.map +0 -1
- package/dist/snapshot/adapters/node-test.js +0 -297
- package/dist/snapshot/adapters/node-test.js.map +0 -1
- package/dist/snapshot/index.cjs +0 -61
- package/dist/snapshot/index.cjs.map +0 -1
- package/dist/snapshot/index.d.cts +0 -40
- package/dist/snapshot/index.d.cts.map +0 -1
- package/dist/snapshot/index.d.ts +0 -40
- package/dist/snapshot/index.d.ts.map +0 -1
- package/dist/snapshot/index.js +0 -44
- package/dist/snapshot/index.js.map +0 -1
- package/dist/snapshot/node-version.cjs +0 -49
- package/dist/snapshot/node-version.cjs.map +0 -1
- package/dist/snapshot/node-version.d.cts +0 -34
- package/dist/snapshot/node-version.d.cts.map +0 -1
- package/dist/snapshot/node-version.d.ts +0 -34
- package/dist/snapshot/node-version.d.ts.map +0 -1
- package/dist/snapshot/node-version.js +0 -44
- package/dist/snapshot/node-version.js.map +0 -1
- package/dist/snapshot/select-adapter.cjs +0 -170
- package/dist/snapshot/select-adapter.cjs.map +0 -1
- package/dist/snapshot/select-adapter.d.cts +0 -128
- package/dist/snapshot/select-adapter.d.cts.map +0 -1
- package/dist/snapshot/select-adapter.d.ts +0 -128
- package/dist/snapshot/select-adapter.d.ts.map +0 -1
- package/dist/snapshot/select-adapter.js +0 -164
- package/dist/snapshot/select-adapter.js.map +0 -1
- package/dist/snapshot/serializer.cjs +0 -246
- package/dist/snapshot/serializer.cjs.map +0 -1
- package/dist/snapshot/serializer.d.cts +0 -126
- package/dist/snapshot/serializer.d.cts.map +0 -1
- package/dist/snapshot/serializer.d.ts +0 -126
- package/dist/snapshot/serializer.d.ts.map +0 -1
- package/dist/snapshot/serializer.js +0 -238
- package/dist/snapshot/serializer.js.map +0 -1
- package/dist/standard-schema.cjs +0 -13
- package/dist/standard-schema.cjs.map +0 -1
- package/dist/standard-schema.d.cts +0 -192
- package/dist/standard-schema.d.cts.map +0 -1
- package/dist/standard-schema.d.ts +0 -192
- package/dist/standard-schema.d.ts.map +0 -1
- package/dist/standard-schema.js +0 -12
- package/dist/standard-schema.js.map +0 -1
- package/dist/types.cjs +0 -22
- package/dist/types.cjs.map +0 -1
- package/dist/types.d.cts +0 -905
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.ts +0 -905
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -21
- package/dist/types.js.map +0 -1
- package/dist/use.cjs +0 -240
- package/dist/use.cjs.map +0 -1
- package/dist/use.d.cts +0 -8
- package/dist/use.d.cts.map +0 -1
- package/dist/use.d.ts +0 -8
- package/dist/use.d.ts.map +0 -1
- package/dist/use.js +0 -236
- package/dist/use.js.map +0 -1
- package/dist/util.cjs +0 -255
- package/dist/util.cjs.map +0 -1
- package/dist/util.d.cts +0 -141
- package/dist/util.d.cts.map +0 -1
- package/dist/util.d.ts +0 -141
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js +0 -234
- package/dist/util.js.map +0 -1
- package/dist/value-to-schema.cjs +0 -537
- package/dist/value-to-schema.cjs.map +0 -1
- package/dist/value-to-schema.d.cts +0 -144
- package/dist/value-to-schema.d.cts.map +0 -1
- package/dist/value-to-schema.d.ts +0 -144
- package/dist/value-to-schema.d.ts.map +0 -1
- package/dist/value-to-schema.js +0 -533
- package/dist/value-to-schema.js.map +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assertion creation factory functions with type-safe sync/async separation.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the core factory functions for creating both synchronous
|
|
5
|
-
* and asynchronous assertions in the Bupkis assertion framework. It implements
|
|
6
|
-
* a dual-creation pattern where `createAssertion()` creates synchronous-only
|
|
7
|
-
* assertions and `createAsyncAssertion()` creates potentially asynchronous
|
|
8
|
-
* assertions, using branded Zod schema types to enforce compile-time safety and
|
|
9
|
-
* prevent accidental mixing of sync and async implementations.
|
|
10
|
-
*
|
|
11
|
-
* The module supports two primary assertion implementation types:
|
|
12
|
-
*
|
|
13
|
-
* - **Schema-based assertions**: Using {@link z.ZodType Zod schemas} for
|
|
14
|
-
* validation
|
|
15
|
-
* - **Function-based assertions**: Using implementation functions that return
|
|
16
|
-
* boolean, void, or Zod schemas for dynamic validation
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* The factory functions use branded types to distinguish between synchronous
|
|
20
|
-
* and asynchronous schema implementations at compile time. This prevents
|
|
21
|
-
* accidentally passing async schemas to sync assertion creators and vice versa,
|
|
22
|
-
* ensuring type safety throughout the assertion system.
|
|
23
|
-
* @example Creating a synchronous string assertion:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* import { createAssertion } from './create.js';
|
|
27
|
-
* import { z } from 'zod';
|
|
28
|
-
*
|
|
29
|
-
* const stringAssertion = createAssertion(['to be a string'], z.string());
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @example Creating an asynchronous Promise resolution assertion:
|
|
33
|
-
*
|
|
34
|
-
* ```ts
|
|
35
|
-
* import { createAsyncAssertion } from './create.js';
|
|
36
|
-
*
|
|
37
|
-
* const promiseAssertion = createAsyncAssertion(
|
|
38
|
-
* ['to resolve'],
|
|
39
|
-
* async (promise) => {
|
|
40
|
-
* try {
|
|
41
|
-
* await promise;
|
|
42
|
-
* return true;
|
|
43
|
-
* } catch {
|
|
44
|
-
* return false;
|
|
45
|
-
* }
|
|
46
|
-
* },
|
|
47
|
-
* );
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* @example Creating parameterized assertions:
|
|
51
|
-
*
|
|
52
|
-
* ```ts
|
|
53
|
-
* import { createAssertion } from './create.js';
|
|
54
|
-
* import { z } from 'zod';
|
|
55
|
-
*
|
|
56
|
-
* const greaterThanAssertion = createAssertion(
|
|
57
|
-
* [z.number(), 'to be greater than', z.number()],
|
|
58
|
-
* (subject, expected) => subject > expected,
|
|
59
|
-
* );
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @packageDocumentation
|
|
63
|
-
* @see {@link AssertionParts} for assertion part structure
|
|
64
|
-
* @see {@link AssertionSlots} for processed slot definitions
|
|
65
|
-
* @see {@link AssertionImplSync} for synchronous implementation types
|
|
66
|
-
* @see {@link AssertionImplAsync} for asynchronous implementation types
|
|
67
|
-
*/
|
|
68
|
-
import { type CreateAssertionFn, type CreateAsyncAssertionFn } from "./assertion-types.cjs";
|
|
69
|
-
/**
|
|
70
|
-
* {@inheritDoc CreateAssertionFn}
|
|
71
|
-
*
|
|
72
|
-
* @function
|
|
73
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
74
|
-
* @group Assertion Creation
|
|
75
|
-
*/
|
|
76
|
-
export declare const createAssertion: CreateAssertionFn;
|
|
77
|
-
/**
|
|
78
|
-
* {@inheritDoc CreateAsyncAssertionFn}
|
|
79
|
-
*
|
|
80
|
-
* @function
|
|
81
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
82
|
-
* @group Assertion Creation
|
|
83
|
-
*/
|
|
84
|
-
export declare const createAsyncAssertion: CreateAsyncAssertionFn;
|
|
85
|
-
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AA0BH,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,8BAA6B;AAG9B;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,iBAmC7B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,sBAmClC,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assertion creation factory functions with type-safe sync/async separation.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the core factory functions for creating both synchronous
|
|
5
|
-
* and asynchronous assertions in the Bupkis assertion framework. It implements
|
|
6
|
-
* a dual-creation pattern where `createAssertion()` creates synchronous-only
|
|
7
|
-
* assertions and `createAsyncAssertion()` creates potentially asynchronous
|
|
8
|
-
* assertions, using branded Zod schema types to enforce compile-time safety and
|
|
9
|
-
* prevent accidental mixing of sync and async implementations.
|
|
10
|
-
*
|
|
11
|
-
* The module supports two primary assertion implementation types:
|
|
12
|
-
*
|
|
13
|
-
* - **Schema-based assertions**: Using {@link z.ZodType Zod schemas} for
|
|
14
|
-
* validation
|
|
15
|
-
* - **Function-based assertions**: Using implementation functions that return
|
|
16
|
-
* boolean, void, or Zod schemas for dynamic validation
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* The factory functions use branded types to distinguish between synchronous
|
|
20
|
-
* and asynchronous schema implementations at compile time. This prevents
|
|
21
|
-
* accidentally passing async schemas to sync assertion creators and vice versa,
|
|
22
|
-
* ensuring type safety throughout the assertion system.
|
|
23
|
-
* @example Creating a synchronous string assertion:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* import { createAssertion } from './create.js';
|
|
27
|
-
* import { z } from 'zod';
|
|
28
|
-
*
|
|
29
|
-
* const stringAssertion = createAssertion(['to be a string'], z.string());
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @example Creating an asynchronous Promise resolution assertion:
|
|
33
|
-
*
|
|
34
|
-
* ```ts
|
|
35
|
-
* import { createAsyncAssertion } from './create.js';
|
|
36
|
-
*
|
|
37
|
-
* const promiseAssertion = createAsyncAssertion(
|
|
38
|
-
* ['to resolve'],
|
|
39
|
-
* async (promise) => {
|
|
40
|
-
* try {
|
|
41
|
-
* await promise;
|
|
42
|
-
* return true;
|
|
43
|
-
* } catch {
|
|
44
|
-
* return false;
|
|
45
|
-
* }
|
|
46
|
-
* },
|
|
47
|
-
* );
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* @example Creating parameterized assertions:
|
|
51
|
-
*
|
|
52
|
-
* ```ts
|
|
53
|
-
* import { createAssertion } from './create.js';
|
|
54
|
-
* import { z } from 'zod';
|
|
55
|
-
*
|
|
56
|
-
* const greaterThanAssertion = createAssertion(
|
|
57
|
-
* [z.number(), 'to be greater than', z.number()],
|
|
58
|
-
* (subject, expected) => subject > expected,
|
|
59
|
-
* );
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @packageDocumentation
|
|
63
|
-
* @see {@link AssertionParts} for assertion part structure
|
|
64
|
-
* @see {@link AssertionSlots} for processed slot definitions
|
|
65
|
-
* @see {@link AssertionImplSync} for synchronous implementation types
|
|
66
|
-
* @see {@link AssertionImplAsync} for asynchronous implementation types
|
|
67
|
-
*/
|
|
68
|
-
import { type CreateAssertionFn, type CreateAsyncAssertionFn } from "./assertion-types.js";
|
|
69
|
-
/**
|
|
70
|
-
* {@inheritDoc CreateAssertionFn}
|
|
71
|
-
*
|
|
72
|
-
* @function
|
|
73
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
74
|
-
* @group Assertion Creation
|
|
75
|
-
*/
|
|
76
|
-
export declare const createAssertion: CreateAssertionFn;
|
|
77
|
-
/**
|
|
78
|
-
* {@inheritDoc CreateAsyncAssertionFn}
|
|
79
|
-
*
|
|
80
|
-
* @function
|
|
81
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
82
|
-
* @group Assertion Creation
|
|
83
|
-
*/
|
|
84
|
-
export declare const createAsyncAssertion: CreateAsyncAssertionFn;
|
|
85
|
-
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AA0BH,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,6BAA6B;AAG9B;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,iBAmC7B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,sBAmClC,CAAC"}
|
package/dist/assertion/create.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assertion creation factory functions with type-safe sync/async separation.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the core factory functions for creating both synchronous
|
|
5
|
-
* and asynchronous assertions in the Bupkis assertion framework. It implements
|
|
6
|
-
* a dual-creation pattern where `createAssertion()` creates synchronous-only
|
|
7
|
-
* assertions and `createAsyncAssertion()` creates potentially asynchronous
|
|
8
|
-
* assertions, using branded Zod schema types to enforce compile-time safety and
|
|
9
|
-
* prevent accidental mixing of sync and async implementations.
|
|
10
|
-
*
|
|
11
|
-
* The module supports two primary assertion implementation types:
|
|
12
|
-
*
|
|
13
|
-
* - **Schema-based assertions**: Using {@link z.ZodType Zod schemas} for
|
|
14
|
-
* validation
|
|
15
|
-
* - **Function-based assertions**: Using implementation functions that return
|
|
16
|
-
* boolean, void, or Zod schemas for dynamic validation
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* The factory functions use branded types to distinguish between synchronous
|
|
20
|
-
* and asynchronous schema implementations at compile time. This prevents
|
|
21
|
-
* accidentally passing async schemas to sync assertion creators and vice versa,
|
|
22
|
-
* ensuring type safety throughout the assertion system.
|
|
23
|
-
* @example Creating a synchronous string assertion:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* import { createAssertion } from './create.js';
|
|
27
|
-
* import { z } from 'zod';
|
|
28
|
-
*
|
|
29
|
-
* const stringAssertion = createAssertion(['to be a string'], z.string());
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @example Creating an asynchronous Promise resolution assertion:
|
|
33
|
-
*
|
|
34
|
-
* ```ts
|
|
35
|
-
* import { createAsyncAssertion } from './create.js';
|
|
36
|
-
*
|
|
37
|
-
* const promiseAssertion = createAsyncAssertion(
|
|
38
|
-
* ['to resolve'],
|
|
39
|
-
* async (promise) => {
|
|
40
|
-
* try {
|
|
41
|
-
* await promise;
|
|
42
|
-
* return true;
|
|
43
|
-
* } catch {
|
|
44
|
-
* return false;
|
|
45
|
-
* }
|
|
46
|
-
* },
|
|
47
|
-
* );
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* @example Creating parameterized assertions:
|
|
51
|
-
*
|
|
52
|
-
* ```ts
|
|
53
|
-
* import { createAssertion } from './create.js';
|
|
54
|
-
* import { z } from 'zod';
|
|
55
|
-
*
|
|
56
|
-
* const greaterThanAssertion = createAssertion(
|
|
57
|
-
* [z.number(), 'to be greater than', z.number()],
|
|
58
|
-
* (subject, expected) => subject > expected,
|
|
59
|
-
* );
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @packageDocumentation
|
|
63
|
-
* @see {@link AssertionParts} for assertion part structure
|
|
64
|
-
* @see {@link AssertionSlots} for processed slot definitions
|
|
65
|
-
* @see {@link AssertionImplSync} for synchronous implementation types
|
|
66
|
-
* @see {@link AssertionImplAsync} for asynchronous implementation types
|
|
67
|
-
*/
|
|
68
|
-
import { z } from 'zod';
|
|
69
|
-
import { AssertionImplementationError } from "../error.js";
|
|
70
|
-
import { isFunction, isStandardSchema, isZodType } from "../guards.js";
|
|
71
|
-
import { CreateAssertionInputSchema, CreateAssertionInputSchemaAsync, } from "../internal-schema.js";
|
|
72
|
-
import { BupkisAssertionFunctionAsync, BupkisAssertionSchemaAsync, } from "./assertion-async.js";
|
|
73
|
-
import { BupkisAssertionStandardSchemaAsync } from "./assertion-standard-schema-async.js";
|
|
74
|
-
import { BupkisAssertionStandardSchemaSync } from "./assertion-standard-schema-sync.js";
|
|
75
|
-
import { BupkisAssertionFunctionSync, BupkisAssertionSchemaSync, } from "./assertion-sync.js";
|
|
76
|
-
import { slotify } from "./slotify.js";
|
|
77
|
-
/**
|
|
78
|
-
* {@inheritDoc CreateAssertionFn}
|
|
79
|
-
*
|
|
80
|
-
* @function
|
|
81
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
82
|
-
* @group Assertion Creation
|
|
83
|
-
*/
|
|
84
|
-
export const createAssertion = (parts, impl) => {
|
|
85
|
-
// Validate inputs using Zod schema
|
|
86
|
-
try {
|
|
87
|
-
CreateAssertionInputSchema.parse([parts, impl]);
|
|
88
|
-
}
|
|
89
|
-
catch (err) {
|
|
90
|
-
if (err instanceof z.ZodError) {
|
|
91
|
-
throw new AssertionImplementationError(`Invalid input parameters: ${z.prettifyError(err)}`, { cause: err });
|
|
92
|
-
}
|
|
93
|
-
/* c8 ignore next */
|
|
94
|
-
throw err;
|
|
95
|
-
}
|
|
96
|
-
const slots = slotify(parts);
|
|
97
|
-
if (isZodType(impl)) {
|
|
98
|
-
return new BupkisAssertionSchemaSync(parts, slots, impl);
|
|
99
|
-
}
|
|
100
|
-
else if (isStandardSchema(impl)) {
|
|
101
|
-
return new BupkisAssertionStandardSchemaSync(parts, slots, impl);
|
|
102
|
-
}
|
|
103
|
-
else if (isFunction(impl)) {
|
|
104
|
-
return new BupkisAssertionFunctionSync(parts, slots, impl);
|
|
105
|
-
}
|
|
106
|
-
// should be impossible if CreateAssertionInputSchema is correct
|
|
107
|
-
/* c8 ignore next */
|
|
108
|
-
throw new AssertionImplementationError('Assertion implementation must be a function, Zod schema, or Standard Schema');
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* {@inheritDoc CreateAsyncAssertionFn}
|
|
112
|
-
*
|
|
113
|
-
* @function
|
|
114
|
-
* @throws {TypeError} Invalid assertion implementation type
|
|
115
|
-
* @group Assertion Creation
|
|
116
|
-
*/
|
|
117
|
-
export const createAsyncAssertion = (parts, impl) => {
|
|
118
|
-
// Validate inputs using Zod schema
|
|
119
|
-
try {
|
|
120
|
-
CreateAssertionInputSchemaAsync.parse([parts, impl]);
|
|
121
|
-
}
|
|
122
|
-
catch (err) {
|
|
123
|
-
if (err instanceof z.ZodError) {
|
|
124
|
-
throw new AssertionImplementationError(`Invalid input parameters: ${z.prettifyError(err)}`, { cause: err });
|
|
125
|
-
}
|
|
126
|
-
/* c8 ignore next */
|
|
127
|
-
throw err;
|
|
128
|
-
}
|
|
129
|
-
const slots = slotify(parts);
|
|
130
|
-
if (isZodType(impl)) {
|
|
131
|
-
return new BupkisAssertionSchemaAsync(parts, slots, impl);
|
|
132
|
-
}
|
|
133
|
-
else if (isStandardSchema(impl)) {
|
|
134
|
-
return new BupkisAssertionStandardSchemaAsync(parts, slots, impl);
|
|
135
|
-
}
|
|
136
|
-
else if (isFunction(impl)) {
|
|
137
|
-
return new BupkisAssertionFunctionAsync(parts, slots, impl);
|
|
138
|
-
}
|
|
139
|
-
// should be impossible if CreateAssertionInputSchemaAsync is correct
|
|
140
|
-
/* c8 ignore next */
|
|
141
|
-
throw new AssertionImplementationError('Assertion implementation must be a function, Zod schema, or Standard Schema');
|
|
142
|
-
};
|
|
143
|
-
//# sourceMappingURL=create.js.map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AK,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC;SAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,4BAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IACD,qEAAqE;IACrE,oBAAoB;IACpB,MAAM,IAAI,4BAA4B,CACpC,6EAA6E,CAC9E,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Utility for formatting AssertionFailure objects with custom diff support.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.formatAssertionFailure = void 0;
|
|
9
|
-
const diff_js_1 = require("../diff.cjs");
|
|
10
|
-
/**
|
|
11
|
-
* Formats an AssertionFailure into a diff string for error output.
|
|
12
|
-
*
|
|
13
|
-
* Precedence:
|
|
14
|
-
*
|
|
15
|
-
* 1. `diff` property - returned as-is
|
|
16
|
-
* 2. `formatActual`/`formatExpected` - used to serialize values for jest-diff
|
|
17
|
-
* 3. Default - uses jest-diff with raw actual/expected values
|
|
18
|
-
*
|
|
19
|
-
* @function
|
|
20
|
-
* @param failure - The AssertionFailure to format
|
|
21
|
-
* @returns Formatted diff string, or null if no diff can be generated
|
|
22
|
-
*/
|
|
23
|
-
const formatAssertionFailure = (failure) => {
|
|
24
|
-
const { actual, diff, diffOptions, expected, formatActual, formatExpected } = failure;
|
|
25
|
-
// Precedence 1: Pre-computed diff string
|
|
26
|
-
if (diff !== undefined) {
|
|
27
|
-
return diff;
|
|
28
|
-
}
|
|
29
|
-
// Need both actual and expected for diff generation
|
|
30
|
-
if (!(0, diff_js_1.shouldGenerateDiff)(actual, expected)) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
// Precedence 2: Custom formatters
|
|
34
|
-
// Wrap in try-catch to provide clearer error messages if formatters throw
|
|
35
|
-
let formattedActual = actual;
|
|
36
|
-
if (formatActual) {
|
|
37
|
-
try {
|
|
38
|
-
formattedActual = formatActual(actual);
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
throw new Error(`AssertionFailure formatActual threw: ${error instanceof Error ? error.message : String(error)}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
let formattedExpected = expected;
|
|
45
|
-
if (formatExpected) {
|
|
46
|
-
try {
|
|
47
|
-
formattedExpected = formatExpected(expected);
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
throw new Error(`AssertionFailure formatExpected threw: ${error instanceof Error ? error.message : String(error)}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// Precedence 3: Default jest-diff
|
|
54
|
-
return (0, diff_js_1.generateDiff)(formattedExpected, formattedActual, {
|
|
55
|
-
aAnnotation: 'expected',
|
|
56
|
-
bAnnotation: 'actual',
|
|
57
|
-
expand: false,
|
|
58
|
-
includeChangeCounts: true,
|
|
59
|
-
...diffOptions,
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
exports.formatAssertionFailure = formatAssertionFailure;
|
|
63
|
-
//# sourceMappingURL=format-assertion-failure.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-assertion-failure.js","sourceRoot":"","sources":["../../src/assertion/format-assertion-failure.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH,yCAA8D;AAE9D;;;;;;;;;;;;GAYG;AACI,MAAM,sBAAsB,GAAG,CACpC,OAAyB,EACV,EAAE;IACjB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,GACzE,OAAO,CAAC;IAEV,yCAAyC;IACzC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oDAAoD;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*/
|
|
6
|
-
import type { AssertionFailure } from "./assertion-types.cjs";
|
|
7
|
-
/**
|
|
8
|
-
* Formats an AssertionFailure into a diff string for error output.
|
|
9
|
-
*
|
|
10
|
-
* Precedence:
|
|
11
|
-
*
|
|
12
|
-
* 1. `diff` property - returned as-is
|
|
13
|
-
* 2. `formatActual`/`formatExpected` - used to serialize values for jest-diff
|
|
14
|
-
* 3. Default - uses jest-diff with raw actual/expected values
|
|
15
|
-
*
|
|
16
|
-
* @function
|
|
17
|
-
* @param failure - The AssertionFailure to format
|
|
18
|
-
* @returns Formatted diff string, or null if no diff can be generated
|
|
19
|
-
*/
|
|
20
|
-
export declare const formatAssertionFailure: (failure: AssertionFailure) => null | string;
|
|
21
|
-
//# sourceMappingURL=format-assertion-failure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-assertion-failure.d.ts","sourceRoot":"","sources":["../../src/assertion/format-assertion-failure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,8BAA6B;AAI7D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,gBAAgB,KACxB,IAAI,GAAG,MA8CT,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility for formatting AssertionFailure objects with custom diff support.
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
import type { AssertionFailure } from "./assertion-types.js";
|
|
7
|
-
/**
|
|
8
|
-
* Formats an AssertionFailure into a diff string for error output.
|
|
9
|
-
*
|
|
10
|
-
* Precedence:
|
|
11
|
-
*
|
|
12
|
-
* 1. `diff` property - returned as-is
|
|
13
|
-
* 2. `formatActual`/`formatExpected` - used to serialize values for jest-diff
|
|
14
|
-
* 3. Default - uses jest-diff with raw actual/expected values
|
|
15
|
-
*
|
|
16
|
-
* @function
|
|
17
|
-
* @param failure - The AssertionFailure to format
|
|
18
|
-
* @returns Formatted diff string, or null if no diff can be generated
|
|
19
|
-
*/
|
|
20
|
-
export declare const formatAssertionFailure: (failure: AssertionFailure) => null | string;
|
|
21
|
-
//# sourceMappingURL=format-assertion-failure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-assertion-failure.d.ts","sourceRoot":"","sources":["../../src/assertion/format-assertion-failure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,6BAA6B;AAI7D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,gBAAgB,KACxB,IAAI,GAAG,MA8CT,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility for formatting AssertionFailure objects with custom diff support.
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
import { generateDiff, shouldGenerateDiff } from "../diff.js";
|
|
7
|
-
/**
|
|
8
|
-
* Formats an AssertionFailure into a diff string for error output.
|
|
9
|
-
*
|
|
10
|
-
* Precedence:
|
|
11
|
-
*
|
|
12
|
-
* 1. `diff` property - returned as-is
|
|
13
|
-
* 2. `formatActual`/`formatExpected` - used to serialize values for jest-diff
|
|
14
|
-
* 3. Default - uses jest-diff with raw actual/expected values
|
|
15
|
-
*
|
|
16
|
-
* @function
|
|
17
|
-
* @param failure - The AssertionFailure to format
|
|
18
|
-
* @returns Formatted diff string, or null if no diff can be generated
|
|
19
|
-
*/
|
|
20
|
-
export const formatAssertionFailure = (failure) => {
|
|
21
|
-
const { actual, diff, diffOptions, expected, formatActual, formatExpected } = failure;
|
|
22
|
-
// Precedence 1: Pre-computed diff string
|
|
23
|
-
if (diff !== undefined) {
|
|
24
|
-
return diff;
|
|
25
|
-
}
|
|
26
|
-
// Need both actual and expected for diff generation
|
|
27
|
-
if (!shouldGenerateDiff(actual, expected)) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
// Precedence 2: Custom formatters
|
|
31
|
-
// Wrap in try-catch to provide clearer error messages if formatters throw
|
|
32
|
-
let formattedActual = actual;
|
|
33
|
-
if (formatActual) {
|
|
34
|
-
try {
|
|
35
|
-
formattedActual = formatActual(actual);
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
throw new Error(`AssertionFailure formatActual threw: ${error instanceof Error ? error.message : String(error)}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
let formattedExpected = expected;
|
|
42
|
-
if (formatExpected) {
|
|
43
|
-
try {
|
|
44
|
-
formattedExpected = formatExpected(expected);
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
throw new Error(`AssertionFailure formatExpected threw: ${error instanceof Error ? error.message : String(error)}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// Precedence 3: Default jest-diff
|
|
51
|
-
return generateDiff(formattedExpected, formattedActual, {
|
|
52
|
-
aAnnotation: 'expected',
|
|
53
|
-
bAnnotation: 'actual',
|
|
54
|
-
expand: false,
|
|
55
|
-
includeChangeCounts: true,
|
|
56
|
-
...diffOptions,
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=format-assertion-failure.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-assertion-failure.js","sourceRoot":"","sources":["../../src/assertion/format-assertion-failure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB;AAE9D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAyB,EACV,EAAE;IACjB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,GACzE,OAAO,CAAC;IAEV,yCAAyC;IACzC,IAAI,IAAI,KAAK,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
-
* @internal
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.trapError = exports.trapPromiseError = exports.trapAsyncFnError = void 0;
|
|
10
|
-
/**
|
|
11
|
-
* Executes & traps a `Promise` rejected from an async function, capturing the
|
|
12
|
-
* error.
|
|
13
|
-
*
|
|
14
|
-
* @function
|
|
15
|
-
* @param fn The function to execute that may throw an error or return a
|
|
16
|
-
* `Promise`
|
|
17
|
-
* @returns Rejection or whatever was fulfilled
|
|
18
|
-
*/
|
|
19
|
-
const trapAsyncFnError = async (fn) => {
|
|
20
|
-
try {
|
|
21
|
-
const result = await fn();
|
|
22
|
-
return { result };
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
return {
|
|
26
|
-
error: error ?? new TypeError(`Function rejected with undefined: ${fn}`),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
exports.trapAsyncFnError = trapAsyncFnError;
|
|
31
|
-
/**
|
|
32
|
-
* Awaits & traps a Promise, capturing any rejection error.
|
|
33
|
-
*
|
|
34
|
-
* @function
|
|
35
|
-
* @param promise The `Promise` to trap
|
|
36
|
-
* @returns Result object
|
|
37
|
-
*/
|
|
38
|
-
const trapPromiseError = async (promise) => {
|
|
39
|
-
try {
|
|
40
|
-
const result = await promise;
|
|
41
|
-
return { result };
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
return { error: error ?? new TypeError('Promise rejected with undefined') };
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
exports.trapPromiseError = trapPromiseError;
|
|
48
|
-
/**
|
|
49
|
-
* Executes & traps a synchronous function that may throw, capturing any thrown
|
|
50
|
-
* error and discarding the result.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
* Avoids throwing `undefined` for some reason.
|
|
54
|
-
* @function
|
|
55
|
-
* @param fn Function to execute
|
|
56
|
-
* @returns Result object
|
|
57
|
-
*/
|
|
58
|
-
const trapError = (fn) => {
|
|
59
|
-
try {
|
|
60
|
-
const result = fn();
|
|
61
|
-
return { result };
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
return { error: error ?? new TypeError(`Function threw undefined: ${fn}`) };
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
exports.trapError = trapError;
|
|
68
|
-
//# sourceMappingURL=assertion-util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-util.js","sourceRoot":"","sources":["../../../src/assertion/impl/assertion-util.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAMH;;;;;;;;GAQG;AACI,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;AAXW,QAAA,gBAAgB,oBAW3B;AAEF;;;;;;GAMG;AACI,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;AATW,QAAA,gBAAgB,oBAS3B;AAEF;;;;;;;;;GASG;AACI,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;AAPW,QAAA,SAAS,aAOpB"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for assertion implementations
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
* @packageDocumentation
|
|
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>;
|
|
17
|
-
/**
|
|
18
|
-
* Awaits & traps a Promise, capturing any rejection error.
|
|
19
|
-
*
|
|
20
|
-
* @function
|
|
21
|
-
* @param promise The `Promise` to trap
|
|
22
|
-
* @returns Result object
|
|
23
|
-
*/
|
|
24
|
-
export declare const trapPromiseError: (promise: PromiseLike<unknown>) => Promise<TrapResult>;
|
|
25
|
-
/**
|
|
26
|
-
* Executes & traps a synchronous function that may throw, capturing any thrown
|
|
27
|
-
* error and discarding the result.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Avoids throwing `undefined` for some reason.
|
|
31
|
-
* @function
|
|
32
|
-
* @param fn Function to execute
|
|
33
|
-
* @returns Result object
|
|
34
|
-
*/
|
|
35
|
-
export declare const trapError: (fn: () => unknown) => TrapResult;
|
|
36
|
-
//# sourceMappingURL=assertion-util.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for assertion implementations
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
* @packageDocumentation
|
|
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>;
|
|
17
|
-
/**
|
|
18
|
-
* Awaits & traps a Promise, capturing any rejection error.
|
|
19
|
-
*
|
|
20
|
-
* @function
|
|
21
|
-
* @param promise The `Promise` to trap
|
|
22
|
-
* @returns Result object
|
|
23
|
-
*/
|
|
24
|
-
export declare const trapPromiseError: (promise: PromiseLike<unknown>) => Promise<TrapResult>;
|
|
25
|
-
/**
|
|
26
|
-
* Executes & traps a synchronous function that may throw, capturing any thrown
|
|
27
|
-
* error and discarding the result.
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Avoids throwing `undefined` for some reason.
|
|
31
|
-
* @function
|
|
32
|
-
* @param fn Function to execute
|
|
33
|
-
* @returns Result object
|
|
34
|
-
*/
|
|
35
|
-
export declare const trapError: (fn: () => unknown) => TrapResult;
|
|
36
|
-
//# sourceMappingURL=assertion-util.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|