bupkis 0.6.0 → 0.7.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 +35 -0
- package/README.md +33 -30
- package/dist/commonjs/assertion/assertion-async.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-async.js +4 -11
- package/dist/commonjs/assertion/assertion-async.js.map +1 -1
- package/dist/commonjs/assertion/assertion-sync.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion-sync.js +3 -13
- package/dist/commonjs/assertion/assertion-sync.js.map +1 -1
- package/dist/commonjs/assertion/assertion.d.ts.map +1 -1
- package/dist/commonjs/assertion/assertion.js +3 -3
- package/dist/commonjs/assertion/assertion.js.map +1 -1
- package/dist/commonjs/assertion/create.d.ts.map +1 -1
- package/dist/commonjs/assertion/create.js +13 -12
- package/dist/commonjs/assertion/create.js.map +1 -1
- package/dist/commonjs/assertion/impl/async-parametric.d.ts +2 -2
- package/dist/commonjs/assertion/impl/async-parametric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/async-parametric.js +5 -48
- package/dist/commonjs/assertion/impl/async-parametric.js.map +1 -1
- package/dist/commonjs/assertion/impl/async.d.ts +4 -4
- package/dist/commonjs/assertion/impl/sync-collection.js +1 -1
- package/dist/commonjs/assertion/impl/sync-collection.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts +2 -2
- package/dist/commonjs/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/commonjs/assertion/impl/sync-parametric.js +14 -5
- package/dist/commonjs/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/commonjs/assertion/impl/sync.d.ts +4 -4
- package/dist/commonjs/assertion/slotify.d.ts.map +1 -1
- package/dist/commonjs/assertion/slotify.js +4 -3
- package/dist/commonjs/assertion/slotify.js.map +1 -1
- package/dist/commonjs/bootstrap.d.ts +4 -4
- package/dist/commonjs/constant.js +7 -1
- package/dist/commonjs/constant.js.map +1 -1
- package/dist/commonjs/error.d.ts +134 -0
- package/dist/commonjs/error.d.ts.map +1 -1
- package/dist/commonjs/error.js +117 -1
- package/dist/commonjs/error.js.map +1 -1
- package/dist/commonjs/expect.d.ts +4 -2
- package/dist/commonjs/expect.d.ts.map +1 -1
- package/dist/commonjs/expect.js +19 -6
- package/dist/commonjs/expect.js.map +1 -1
- package/dist/commonjs/guards.d.ts.map +1 -1
- package/dist/commonjs/guards.js +4 -1
- package/dist/commonjs/guards.js.map +1 -1
- package/dist/commonjs/index.d.ts +6 -5
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +6 -3
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/value-to-schema.d.ts.map +1 -1
- package/dist/commonjs/value-to-schema.js +3 -2
- package/dist/commonjs/value-to-schema.js.map +1 -1
- package/dist/esm/assertion/assertion-async.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-async.js +5 -12
- package/dist/esm/assertion/assertion-async.js.map +1 -1
- package/dist/esm/assertion/assertion-sync.d.ts.map +1 -1
- package/dist/esm/assertion/assertion-sync.js +7 -17
- package/dist/esm/assertion/assertion-sync.js.map +1 -1
- package/dist/esm/assertion/assertion.d.ts.map +1 -1
- package/dist/esm/assertion/assertion.js +6 -6
- package/dist/esm/assertion/assertion.js.map +1 -1
- package/dist/esm/assertion/create.d.ts.map +1 -1
- package/dist/esm/assertion/create.js +13 -12
- package/dist/esm/assertion/create.js.map +1 -1
- package/dist/esm/assertion/impl/async-parametric.d.ts +2 -2
- package/dist/esm/assertion/impl/async-parametric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/async-parametric.js +5 -48
- package/dist/esm/assertion/impl/async-parametric.js.map +1 -1
- package/dist/esm/assertion/impl/async.d.ts +4 -4
- package/dist/esm/assertion/impl/sync-collection.js +1 -1
- package/dist/esm/assertion/impl/sync-collection.js.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.d.ts +2 -2
- package/dist/esm/assertion/impl/sync-parametric.d.ts.map +1 -1
- package/dist/esm/assertion/impl/sync-parametric.js +14 -5
- package/dist/esm/assertion/impl/sync-parametric.js.map +1 -1
- package/dist/esm/assertion/impl/sync.d.ts +4 -4
- package/dist/esm/assertion/slotify.d.ts.map +1 -1
- package/dist/esm/assertion/slotify.js +4 -3
- package/dist/esm/assertion/slotify.js.map +1 -1
- package/dist/esm/bootstrap.d.ts +4 -4
- package/dist/esm/constant.js +6 -0
- package/dist/esm/constant.js.map +1 -1
- package/dist/esm/error.d.ts +134 -0
- package/dist/esm/error.d.ts.map +1 -1
- package/dist/esm/error.js +110 -1
- package/dist/esm/error.js.map +1 -1
- package/dist/esm/expect.d.ts +4 -2
- package/dist/esm/expect.d.ts.map +1 -1
- package/dist/esm/expect.js +22 -9
- package/dist/esm/expect.js.map +1 -1
- package/dist/esm/guards.d.ts.map +1 -1
- package/dist/esm/guards.js +4 -1
- package/dist/esm/guards.js.map +1 -1
- package/dist/esm/index.d.ts +6 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/value-to-schema.d.ts.map +1 -1
- package/dist/esm/value-to-schema.js +3 -2
- package/dist/esm/value-to-schema.js.map +1 -1
- package/package.json +17 -21
- package/src/assertion/assertion-async.ts +9 -18
- package/src/assertion/assertion-sync.ts +12 -24
- package/src/assertion/assertion.ts +7 -6
- package/src/assertion/create.ts +31 -12
- package/src/assertion/impl/async-parametric.ts +7 -49
- package/src/assertion/impl/sync-collection.ts +1 -1
- package/src/assertion/impl/sync-parametric.ts +19 -5
- package/src/assertion/slotify.ts +4 -3
- package/src/constant.ts +7 -0
- package/src/error.ts +188 -0
- package/src/expect.ts +31 -10
- package/src/guards.ts +4 -1
- package/src/index.ts +2 -1
- package/src/value-to-schema.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.2](https://github.com/boneskull/bupkis/compare/bupkis-v0.7.1...bupkis-v0.7.2) (2025-09-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **release:** revert change to publish action ([5342626](https://github.com/boneskull/bupkis/commit/5342626daa65b75994bd9681f356f24fef7a25ba))
|
|
9
|
+
|
|
10
|
+
## [0.7.1](https://github.com/boneskull/bupkis/compare/bupkis-v0.7.0...bupkis-v0.7.1) (2025-09-22)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **release:** release 0.7.0 ([488f0dc](https://github.com/boneskull/bupkis/commit/488f0dc6f74a8c83fd97ec6ea1bd937bf2df0032))
|
|
16
|
+
* **release:** release 0.7.1 ([7505fb8](https://github.com/boneskull/bupkis/commit/7505fb810a22d0f433af6403c9ff3fa492279884))
|
|
17
|
+
|
|
18
|
+
## [0.7.0](https://github.com/boneskull/bupkis/compare/bupkis-v0.7.0...bupkis-v0.7.0) (2025-09-22)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **release:** release 0.7.0 ([488f0dc](https://github.com/boneskull/bupkis/commit/488f0dc6f74a8c83fd97ec6ea1bd937bf2df0032))
|
|
24
|
+
|
|
25
|
+
## [0.7.0](https://github.com/boneskull/bupkis/compare/bupkis-v0.6.0...bupkis-v0.7.0) (2025-09-22)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* add proper errors, codes ([1f3b149](https://github.com/boneskull/bupkis/commit/1f3b149e1aa42f90469b96244224fe6736175c25))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **guards:** thenable.then must have at least one parameter ([41a987e](https://github.com/boneskull/bupkis/commit/41a987e5ec131b780124bf6459b900bf15643987))
|
|
36
|
+
* re-export schema namespace ([497bad7](https://github.com/boneskull/bupkis/commit/497bad7104b6ee5195f5c4d566837e8e34a1d744))
|
|
37
|
+
|
|
3
38
|
## [0.6.0](https://github.com/boneskull/bupkis/compare/bupkis-v0.5.1...bupkis-v0.6.0) (2025-09-22)
|
|
4
39
|
|
|
5
40
|
|
package/README.md
CHANGED
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
## Motivation
|
|
19
19
|
|
|
20
|
-
> "
|
|
20
|
+
> _"Another assertion library? You cannot be serious, dogg. My test framework has its own assertions!"_
|
|
21
21
|
>
|
|
22
|
-
>
|
|
22
|
+
> <small>‒sickos, probably</small>
|
|
23
23
|
|
|
24
24
|
Look, we're ~~old~~ ~~wizened~~ ~~experienced~~ knowledgeable and we've written a lot of tests. We've used a lot of assertion libraries. There are ones we prefer and ones we don't.
|
|
25
25
|
|
|
26
|
-
But none of them do quite what
|
|
26
|
+
But none of them do quite what <strong><span class="bupkis">BUPKIS</span></strong> does. We want an assertion library that prioritizes:
|
|
27
27
|
|
|
28
28
|
- Type safety
|
|
29
29
|
- Uncompromisable extensibility
|
|
@@ -33,7 +33,7 @@ We can think of several that tick two-thirds of those boxes! But _we demand the
|
|
|
33
33
|
|
|
34
34
|
> ⚠️ **Caution!**
|
|
35
35
|
>
|
|
36
|
-
> Assertion libraries tend come in two flavors: chainable or stiff & traditional. But because these styles are likely _familiar_ to you, you may hate
|
|
36
|
+
> Assertion libraries tend come in two flavors: chainable or stiff & traditional. But because these styles are likely _familiar_ to you, you may hate <strong><span class="bupkis">BUPKIS</span></strong>.
|
|
37
37
|
>
|
|
38
38
|
> We _want_ you to like it, yes. But if you don't, we're content with just making our point and asking the following favor of the reader:
|
|
39
39
|
>
|
|
@@ -43,9 +43,9 @@ The following is a brief overview of the design choices we made to serve these g
|
|
|
43
43
|
|
|
44
44
|
### Natural Language Assertions
|
|
45
45
|
|
|
46
|
-
In
|
|
46
|
+
In <strong><span class="bupkis">BUPKIS</span></strong>, "natural language" is the means to the end of "a small API surface".
|
|
47
47
|
|
|
48
|
-
When you're using
|
|
48
|
+
When you're using <strong><span class="bupkis">BUPKIS</span></strong>, you **don't** write this:
|
|
49
49
|
|
|
50
50
|
```js
|
|
51
51
|
expect(actual).toEqual(expected);
|
|
@@ -73,7 +73,7 @@ If another assertion library wants you to write:
|
|
|
73
73
|
expect(actual).to.be.a('string');
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
Then
|
|
76
|
+
Then <strong><span class="bupkis">BUPKIS</span></strong> wants you to write:
|
|
77
77
|
|
|
78
78
|
```js
|
|
79
79
|
expect(actual, 'to be a string');
|
|
@@ -81,13 +81,13 @@ expect(actual, 'to be a string');
|
|
|
81
81
|
expect(actual, 'to be an string');
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
Can't remember the phrase? Did you forget a word or make a typo? Maybe you also forgot
|
|
84
|
+
Can't remember the phrase? Did you forget a word or make a typo? Maybe you also forgot <strong><span class="bupkis">BUPKIS</span></strong> is type-safe?! You'll get a nice squiggly for your trouble.
|
|
85
85
|
|
|
86
86
|
This isn't black magic. It ain't no _cauldron_. We're not just _throwing rat tails and `string`s into a function and stirring that shit up._
|
|
87
87
|
|
|
88
|
-
> "Preposterous!
|
|
88
|
+
> _"Preposterous! Functions. Things of that nature."_
|
|
89
89
|
>
|
|
90
|
-
>
|
|
90
|
+
> <small>‒the reader and/or more sickos</small>
|
|
91
91
|
|
|
92
92
|
You may wonder how this could this be anything _but_ loosey-goosey _senselessness_. On the contrary—we have _conventions_!
|
|
93
93
|
|
|
@@ -95,9 +95,9 @@ You may wonder how this could this be anything _but_ loosey-goosey _senselessnes
|
|
|
95
95
|
|
|
96
96
|
To formalize the conventions at a high level:
|
|
97
97
|
|
|
98
|
-
- The first parameter to a
|
|
98
|
+
- The first parameter to a <strong><span class="bupkis">BUPKIS</span></strong> assertion is always the _subject_ ([def.](https://bupkis.zip/documents/Reference.Glossary_of_Terms#subject)).
|
|
99
99
|
|
|
100
|
-
- The "string" part of a
|
|
100
|
+
- The "string" part of a <strong><span class="bupkis">BUPKIS</span></strong> assertion is known as a _phrase_. Every expectation will contain _at minimum_ one (1) phrase. As you can see from the above "to be a string" example, phrases often have aliases.
|
|
101
101
|
|
|
102
102
|
- Assertions may have multiple phrases or parameters, but the simplest assertions always look like this:
|
|
103
103
|
|
|
@@ -111,12 +111,12 @@ To formalize the conventions at a high level:
|
|
|
111
111
|
expect(subject, 'phrase', [parameter?, phrase?, parameter?, ...]);
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
- If an assertion's phrase contains something like "to satisfy" or "satisfying", then the next parameter has special meaning. It is somewhat like Jest's `expect.objectContaining()`, but more powerful (prior art: [unexpected's `to satisfy` assertion]
|
|
114
|
+
- If an assertion's phrase contains something like "to satisfy" or "satisfying", then the next parameter has special meaning. It is somewhat like Jest's `expect.objectContaining()`, but more powerful (prior art: [unexpected's `to satisfy` assertion][unexpected-to-satisfy]).
|
|
115
115
|
|
|
116
116
|
There are three (3) things to know about this parameter:
|
|
117
|
-
1. It matches objects, but only verifies that the keys provided are present and the values
|
|
118
|
-
2. If the value of any given property in an object is a _regular expression_, the
|
|
119
|
-
3. _Any assertion_ (including custom assertions) can be embedded within
|
|
117
|
+
1. It matches objects, but only verifies that the keys provided are a) **present** and the values _satisfy_ the values in the expected object.
|
|
118
|
+
2. If the value of any given property in an object is a _regular expression_ (`RegExp`), the actual value will be coerced to a string and tested against the regular expression. This provides easy string matching within nested properties (see below example for what this looks like).
|
|
119
|
+
3. _Any assertion_ (including custom assertions) can be embedded within an object parameter via the `expect.it()` function:
|
|
120
120
|
|
|
121
121
|
```ts
|
|
122
122
|
expect(user, 'to satisfy', {
|
|
@@ -134,9 +134,9 @@ To formalize the conventions at a high level:
|
|
|
134
134
|
});
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
> See [Embeddable Assertions][] for more a thorough explanation.
|
|
137
|
+
> 👉 See [Embeddable Assertions][] for more a thorough explanation of `expect.it()`.
|
|
138
138
|
|
|
139
|
-
- You can _negate_
|
|
139
|
+
- You can _negate_ **any** assertion by prepending its first phrase with `not`. For example:
|
|
140
140
|
|
|
141
141
|
```js
|
|
142
142
|
expect(actual, 'to be', expected);
|
|
@@ -151,11 +151,11 @@ To formalize the conventions at a high level:
|
|
|
151
151
|
);
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
_How about them apples._
|
|
155
155
|
|
|
156
156
|
### Custom Assertions Built With Zod
|
|
157
157
|
|
|
158
|
-
[Zod][] is a popular object validation library which does some heavy lifting for
|
|
158
|
+
[Zod][] is a popular object validation library which does some heavy lifting for <strong><span class="bupkis">BUPKIS</span></strong>—most of the built-in assertions are implemented using Zod schemas. And so <strong><span class="bupkis">BUPKIS</span></strong> extends this capability to you.
|
|
159
159
|
|
|
160
160
|
An example will be illuminating. What follows is a ~~stupid~~ ~~quick~~ _stupid_ example of a creating and "registering" a basic assertion _which can be invoked using two different phrases_:
|
|
161
161
|
|
|
@@ -177,11 +177,13 @@ expect('fam', 'to be bussin');
|
|
|
177
177
|
expect('skiball lavatory', 'to be a string');
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
> 📒 Registration?
|
|
180
|
+
> 📒 Assertion Registration?
|
|
181
181
|
>
|
|
182
|
-
> "Registration" of an assertion (
|
|
182
|
+
> "Registration" of an assertion (a misnomer; there is no stateful "registry" in <strong><span class="bupkis">BUPKIS</span></strong>) is as straightforward as passing an array of objects created by `createAssertion()` and/or `createAsyncAssertion()` to the `use()` function.
|
|
183
183
|
>
|
|
184
|
-
> `use()`, as exported from `bupkis`, returns a new `expect()`/`expectAsync()` pair that
|
|
184
|
+
> `use()`, as exported from `bupkis`, returns a new `expect()`/`expectAsync()` pair that which can execute _your_ custom assertions _in addition to_ every built-in assertion.
|
|
185
|
+
>
|
|
186
|
+
> The `expect()`/`expectAsync()` functions returned by `use()` are fully type-safe and aware of your custom assertions. Each `expect()`/`expectAsync()` function has a `.use()` method as well; this allows you to compose multiple sets of assertions together (like from several assertion plugin packages).
|
|
185
187
|
|
|
186
188
|
**Zod makes it extremely easy to create most custom assertions**. But despite its power, it can't do _everything_ we need an assertion to do; for those situations, there's also a [function-based API][custom-assertion-function] for use with [parametric][] and behavioral (e.g., involving function execution) assertions.
|
|
187
189
|
|
|
@@ -189,7 +191,7 @@ expect('skiball lavatory', 'to be a string');
|
|
|
189
191
|
|
|
190
192
|
### Excruciating Type Safety
|
|
191
193
|
|
|
192
|
-
We have tried to make
|
|
194
|
+
We have tried to make <strong><span class="bupkis">BUPKIS</span></strong> is as type-safe as possible. To be clear, _that is pretty damn possible_. This means:
|
|
193
195
|
|
|
194
196
|
- Every built-in assertion is fully type-safe and is declared as an overload for `expect()` or `expectAsync()`.
|
|
195
197
|
- Every _custom_ assertion is _also_ fully type-safe and is declared as an overload for `expect()` or `expectAsync()` (as returned from `use()`)
|
|
@@ -201,11 +203,11 @@ We have tried to make **BUPKIS** is as type-safe as possible. To be clear, _that
|
|
|
201
203
|
|
|
202
204
|
**Node.js**: ^20.19.0, ^22.12.0, >=23
|
|
203
205
|
|
|
204
|
-
|
|
206
|
+
<strong><span class="bupkis">BUPKIS</span></strong> has a peer dependency on [Zod][] v4+, but will install it as an optional dependency if you are not already using it.
|
|
205
207
|
|
|
206
|
-
|
|
208
|
+
<strong><span class="bupkis">BUPKIS</span></strong> ships as a dual CJS/ESM package.
|
|
207
209
|
|
|
208
|
-
> Disclaimer:
|
|
210
|
+
> Disclaimer: <strong><span class="bupkis">BUPKIS</span></strong> has been designed to run on Node.js in a development environment. Anyone attempting to deploy <strong><span class="bupkis">BUPKIS</span></strong> to some server somewhere will get what is coming to them.
|
|
209
211
|
|
|
210
212
|
## Installation
|
|
211
213
|
|
|
@@ -221,14 +223,14 @@ npm install bupkis -D
|
|
|
221
223
|
|
|
222
224
|
## Acknowledgements
|
|
223
225
|
|
|
224
|
-
- [Unexpected][] is the main inspiration for
|
|
225
|
-
- [Zod][] is a popular object validation library upon which
|
|
226
|
+
- [Unexpected][] is the main inspiration for <strong><span class="bupkis">BUPKIS</span></strong>. However, creating types for this library was exceedingly difficult (and was in fact the first thing we tried). Despite that drawback, we found it exquisitely usable.
|
|
227
|
+
- [Zod][] is a popular object validation library upon which <strong><span class="bupkis">BUPKIS</span></strong> builds many of its own assertions.
|
|
226
228
|
- [fast-check][]: Thanks to Nicholas Dubien for this library. There is **no better library** for an assertion library to use to test itself! Well, besides itself, we mean. How about _in addition to_ itself? Yes. Thank you!
|
|
227
229
|
- [tshy][] from Isaac Schlueter. Thanks for making dual ESM/CJS packages easy and not too fancy.
|
|
228
230
|
- [TypeDoc][] it really documents the hell out of TypeScript projects.
|
|
229
231
|
- [@cjihrig](https://github.com/cjihrig) and other Node.js contributors for the thoughtfulness put into [`node:test`](https://nodejs.org/api/test.html) that make it my current test-runner-of-choice.
|
|
230
232
|
|
|
231
|
-
## Why is it called
|
|
233
|
+
## Why is it called BUPKIS?
|
|
232
234
|
|
|
233
235
|
TODO: think of good reason and fill in later
|
|
234
236
|
|
|
@@ -248,3 +250,4 @@ Copyright © 2025 Christopher Hiller. Licensed under [BlueOak-1.0.0](https://blu
|
|
|
248
250
|
[tshy]: https://github.com/isaacs/tshy
|
|
249
251
|
[typedoc]: https://typedoc.org
|
|
250
252
|
[embeddable assertions]: https://bupkis.zip/documents/Basic_Usage#embeddable-assertions
|
|
253
|
+
[unexpected-to-satisfy]: https://unexpected.js.org/assertions/any/to-satisfy/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-async.d.ts","sourceRoot":"","sources":["../../../src/assertion/assertion-async.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assertion-async.d.ts","sourceRoot":"","sources":["../../../src/assertion/assertion-async.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cA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jC,OAAO,CAAC,IAAI,CAAC;CAiCjB;AAED;;;;;;;;;;;GAWG;AAEH,qBAAa,0BAA0B,CACnC,KAAK,SAAS,cAAc,EAC5B,IAAI,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAC5C,KAAK,SAAS,cAAc,CAAC,KAAK,CAAC,CAErC,SAAQ,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAC/C,YAAW,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAEpC,YAAY,CACzB,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC,EACjC,KAAK,EAAE,OAAO,EAAE,EAChB,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACrC,WAAW,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC;IA0BD,gBAAgB,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EAC7D,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IA4E/B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;CAehC"}
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BupkisAssertionSchemaAsync = exports.BupkisAssertionFunctionAsync = exports.BupkisAssertionAsync = void 0;
|
|
7
|
-
const debug_1 = __importDefault(require("debug"));
|
|
8
7
|
const util_1 = require("util");
|
|
9
8
|
const v4_1 = __importDefault(require("zod/v4"));
|
|
10
9
|
const constant_js_1 = require("../constant.js");
|
|
@@ -12,7 +11,6 @@ const error_js_1 = require("../error.js");
|
|
|
12
11
|
const guards_js_1 = require("../guards.js");
|
|
13
12
|
const metadata_js_1 = require("../metadata.js");
|
|
14
13
|
const assertion_js_1 = require("./assertion.js");
|
|
15
|
-
const debug = (0, debug_1.default)('bupkis:assertion:async');
|
|
16
14
|
class BupkisAssertionAsync extends assertion_js_1.BupkisAssertion {
|
|
17
15
|
async parseValuesAsync(args) {
|
|
18
16
|
const { slots } = this;
|
|
@@ -36,7 +34,6 @@ class BupkisAssertionAsync extends assertion_js_1.BupkisAssertion {
|
|
|
36
34
|
// unknown/any accept anything
|
|
37
35
|
// IMPORTANT: do not use a type guard here; it will break inference
|
|
38
36
|
if (slot.def.type === 'unknown' || slot.def.type === 'any') {
|
|
39
|
-
debug('Skipping unknown/any slot validation for arg', arg);
|
|
40
37
|
parsedValues.push(arg);
|
|
41
38
|
exactMatch = false;
|
|
42
39
|
continue;
|
|
@@ -104,7 +101,7 @@ class BupkisAssertionFunctionAsync extends BupkisAssertionAsync {
|
|
|
104
101
|
throw this.fromZodError(result, stackStartFn, parsedValues);
|
|
105
102
|
}
|
|
106
103
|
else if (result) {
|
|
107
|
-
throw new
|
|
104
|
+
throw new error_js_1.AssertionImplementationError(`Invalid return type from assertion ${this}; expected boolean, ZodType, or AssertionFailure`, { result });
|
|
108
105
|
}
|
|
109
106
|
}
|
|
110
107
|
}
|
|
@@ -127,12 +124,9 @@ class BupkisAssertionSchemaAsync extends BupkisAssertionAsync {
|
|
|
127
124
|
const cachedValidation = parseResult?.success
|
|
128
125
|
? parseResult.subjectValidationResult
|
|
129
126
|
: undefined;
|
|
130
|
-
if (cachedValidation) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// Subject validation failed during parseValuesAsync, throw the cached error
|
|
134
|
-
throw this.fromZodError(cachedValidation.error, stackStartFn, parsedValues);
|
|
135
|
-
}
|
|
127
|
+
if (cachedValidation && !cachedValidation.success) {
|
|
128
|
+
// Subject validation failed during parseValuesAsync, throw the cached error
|
|
129
|
+
throw this.fromZodError(cachedValidation.error, stackStartFn, parsedValues);
|
|
136
130
|
}
|
|
137
131
|
// Fall back to standard validation if no cached result
|
|
138
132
|
const [subject] = parsedValues;
|
|
@@ -187,7 +181,6 @@ class BupkisAssertionSchemaAsync extends BupkisAssertionAsync {
|
|
|
187
181
|
}
|
|
188
182
|
// Standard slot processing for non-optimized cases
|
|
189
183
|
if (slot.def.type === 'unknown' || slot.def.type === 'any') {
|
|
190
|
-
debug('Skipping unknown/any slot validation for arg', arg);
|
|
191
184
|
parsedValues.push(arg);
|
|
192
185
|
exactMatch = false;
|
|
193
186
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-async.js","sourceRoot":"","sources":["../../../src/assertion/assertion-async.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"assertion-async.js","sourceRoot":"","sources":["../../../src/assertion/assertion-async.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA+B;AAC/B,gDAAuB;AAEvB,gDAAgD;AAChD,0CAA2E;AAC3E,4CAMsB;AACtB,gDAAgD;AAchD,iDAAiD;AAEjD,MAAsB,oBAKpB,SAAQ,8BAAmC;IAU3C,KAAK,CAAC,gBAAgB,CACpB,IAAU;QAEV,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,YAAY,GAAU,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YACjC,OAAO;gBACL,OAAO,EAAE,KAAK;aACf,CAAC;QACJ,CAAC;QACD,IAAI,UAAU,GAAG,IAAI,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;YACvB,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAEpB,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;YACnE,IAAI,mBAAmB,KAAK,IAAI,EAAE,CAAC;gBACjC,SAAS;Y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/assertion-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"assertion-sync.d.ts","sourceRoot":"","sources":["../../../src/assertion/assertion-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIjD;;;;GAIG;AACH,8BAAsB,mBAAmB,CACrC,KAAK,SAAS,cAAc,EAC5B,IAAI,SAAS,iBAAiB,CAAC,KAAK,CAAC,EACrC,KAAK,SAAS,cAAc,CAAC,KAAK,CAAC,CAErC,SAAQ,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAC1C,YAAW,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAE5C;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CACd,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC,EACjC,IAAI,EAAE,OAAO,EAAE,EACf,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACrC,WAAW,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,GAChC,IAAI;IAEP;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EACzC,IAAI,EAAE,IAAI,GACT,YAAY,CAAC,KAAK,CAAC;CA4CvB;AAED,qBAAa,2BAA2B,CACpC,KAAK,SAAS,cAAc,EAC5B,IAAI,SAAS,mBAAmB,CAAC,KAAK,CAAC,EACvC,KAAK,SAAS,cAAc,CAAC,KAAK,CAAC,CAErC,SAAQ,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAC9C,YAAW,qBAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAE3C,OAAO,CACd,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC,EACjC,IAAI,EAAE,OAAO,EAAE,EACf,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACrC,YAAY,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,GACjC,IAAI;CA0CR;AAED;;;;;;;;;;;GAWG;AAEH,qBAAa,yBAAyB,CAClC,KAAK,SAAS,cAAc,EAC5B,IAAI,SAAS,uBAAuB,CAAC,KAAK,CAAC,EAC3C,KAAK,SAAS,cAAc,CAAC,KAAK,CAAC,CAErC,SAAQ,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAC9C,YAAW,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAEzC,OAAO,CACd,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC,EACjC,KAAK,EAAE,OAAO,EAAE,EAChB,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACrC,WAAW,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,GAChC,IAAI;IA2BE,WAAW,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EAClD,IAAI,EAAE,IAAI,GACT,YAAY,CAAC,KAAK,CAAC;IAwEtB;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;CAehC"}
|
|
@@ -62,15 +62,10 @@ class BupkisAssertionSync extends assertion_js_1.BupkisAssertion {
|
|
|
62
62
|
// unknown/any accept anything
|
|
63
63
|
// IMPORTANT: do not use a type guard here
|
|
64
64
|
if (slot.def.type === 'unknown' || slot.def.type === 'any') {
|
|
65
|
-
// debug('Skipping unknown/any slot validation for arg', arg);
|
|
66
65
|
parsedValues.push(arg);
|
|
67
66
|
exactMatch = false;
|
|
68
67
|
continue;
|
|
69
68
|
}
|
|
70
|
-
// low-effort check
|
|
71
|
-
if ((0, guards_js_1.isZodPromise)(slot)) {
|
|
72
|
-
throw new TypeError(`${this} expects a Promise for slot ${i}; use expectAsync() instead of expect()`);
|
|
73
|
-
}
|
|
74
69
|
const result = slot.safeParse(arg);
|
|
75
70
|
if (!result.success) {
|
|
76
71
|
return {
|
|
@@ -95,9 +90,9 @@ class BupkisAssertionFunctionSync extends BupkisAssertionSync {
|
|
|
95
90
|
if ((0, guards_js_1.isPromiseLike)(result)) {
|
|
96
91
|
// Avoid unhandled promise rejection
|
|
97
92
|
Promise.resolve(result).catch((err) => {
|
|
98
|
-
debug(
|
|
93
|
+
debug(`⚠️ Ate unhandled rejection from assertion %s: %O`, this, err);
|
|
99
94
|
});
|
|
100
|
-
throw new
|
|
95
|
+
throw new error_js_1.UnexpectedAsyncError(`Assertion ${this} returned a Promise; use expectAsync() instead of expect()`);
|
|
101
96
|
}
|
|
102
97
|
if ((0, guards_js_1.isZodType)(result)) {
|
|
103
98
|
const zodResult = result.safeParse(parsedValues[0]);
|
|
@@ -123,7 +118,7 @@ class BupkisAssertionFunctionSync extends BupkisAssertionSync {
|
|
|
123
118
|
throw this.fromZodError(result, stackStartFn, parsedValues);
|
|
124
119
|
}
|
|
125
120
|
else if (result) {
|
|
126
|
-
throw new
|
|
121
|
+
throw new error_js_1.AssertionImplementationError(`Invalid return type from assertion ${this}; expected boolean, ZodType, or AssertionFailure`, { result });
|
|
127
122
|
}
|
|
128
123
|
}
|
|
129
124
|
}
|
|
@@ -147,7 +142,6 @@ class BupkisAssertionSchemaSync extends BupkisAssertionSync {
|
|
|
147
142
|
? parseResult.subjectValidationResult
|
|
148
143
|
: undefined;
|
|
149
144
|
if (cachedValidation) {
|
|
150
|
-
debug('Using cached subject validation result from parseValues for %s', this);
|
|
151
145
|
if (!cachedValidation.success) {
|
|
152
146
|
// Subject validation failed during parseValues, throw the cached error
|
|
153
147
|
throw this.fromZodError(cachedValidation.error, stackStartFn, parsedValues);
|
|
@@ -199,14 +193,10 @@ class BupkisAssertionSchemaSync extends BupkisAssertionSync {
|
|
|
199
193
|
}
|
|
200
194
|
// Standard slot processing for non-optimized cases
|
|
201
195
|
if (slot.def.type === 'unknown' || slot.def.type === 'any') {
|
|
202
|
-
debug('Skipping unknown/any slot validation for arg', arg);
|
|
203
196
|
parsedValues.push(arg);
|
|
204
197
|
exactMatch = false;
|
|
205
198
|
continue;
|
|
206
199
|
}
|
|
207
|
-
if ((0, guards_js_1.isZodPromise)(slot)) {
|
|
208
|
-
throw new TypeError(`${this} expects a Promise for slot ${i}; use expectAsync() instead of expect()`);
|
|
209
|
-
}
|
|
210
200
|
const result = slot.safeParse(arg);
|
|
211
201
|
if (!result.success) {
|
|
212
202
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-sync.js","sourceRoot":"","sources":["../../../src/assertion/assertion-sync.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"assertion-sync.js","sourceRoot":"","sources":["../../../src/assertion/assertion-sync.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAEH,kDAAgC;AAChC,+BAA+B;AAC/B,+BAA2B;AAE3B,gDAAgD;AAChD,0CAIqB;AACrB,4CAMsB;AACtB,gDAAgD;AAchD,iDAAiD;AAEjD,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,uBAAuB,CAAC,CAAC;AAEnD;;;;GAIG;AACH,MAAsB,mBAKpB,SAAQ,8BAAmC;IAiB3C;;;;;;;;;;;;;;OAcG;IACH,WAAW,CACT,IAAU;QAEV,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,YAAY,GAAU,EAAE,CAAC;QAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;QACxD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ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I,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;YAClE,MAAM,IAAI,GAAG,4BAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAC5C,OAAO,4BAAc,IAAI,IAAI,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,OAAO,cAAc,IAAI,wBAAwB,CAAC;IACpD,CAAC;CACF;AAtID,8DAsIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion.d.ts","sourceRoot":"","sources":["../../../src/assertion/assertion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"assertion.d.ts","sourceRoot":"","sources":["../../../src/assertion/assertion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAG3B,OAAO,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAEnE,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAa9B;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;EAGnC,CAAC;AAEJ;;GAEG;AACH,8BAAsB,eAAe,CACnC,KAAK,SAAS,cAAc,EAC5B,IAAI,SAAS,aAAa,CAAC,KAAK,CAAC,EACjC,KAAK,SAAS,cAAc,CAAC,KAAK,CAAC,CACnC,YAAW,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAKtC,QAAQ,CAAC,KAAK,EAAE,KAAK;IACrB,QAAQ,CAAC,KAAK,EAAE,KAAK;IACrB,QAAQ,CAAC,IAAI,EAAE,IAAI;IALrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBAGT,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI;IAMd,QAAQ,IAAI,iBAAiB,GAAG,SAAS;IAIhD;;OAEG;IACI,QAAQ,IAAI,MAAM;IAuFzB;;;;;;;;;;;;OAYG;IACH;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,YAAY,CAAC,KAAK,SAAS,cAAc,EACjD,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACrC,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,GAC1B,cAAc;IAmBjB,SAAS,CAAC,2BAA2B,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EACnE,IAAI,EAAE,IAAI,GACT,YAAY,CAAC,KAAK,CAAC,GAAG,SAAS;IAQlC;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,IAAI,SAAS,WAAW,CAAC,KAAK,CAAC,EAC3D,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,GACd,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC;IA6BhC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,mBAAmB;CAW5B"}
|
|
@@ -47,7 +47,7 @@ class BupkisAssertion {
|
|
|
47
47
|
this.slots = slots;
|
|
48
48
|
this.impl = impl;
|
|
49
49
|
this.id = this.generateAssertionId();
|
|
50
|
-
debug('Created assertion %s', this);
|
|
50
|
+
debug('ℹ Created assertion %s', this);
|
|
51
51
|
}
|
|
52
52
|
metadata() {
|
|
53
53
|
return exports.AssertionMetadataRegistry.get(this);
|
|
@@ -75,7 +75,7 @@ class BupkisAssertion {
|
|
|
75
75
|
: 'custom';
|
|
76
76
|
}
|
|
77
77
|
catch (err) {
|
|
78
|
-
debug(
|
|
78
|
+
debug(`⚠️ WARNING: Unable to extract custom class name from Zod type(did Zod's API change?): ${err}`);
|
|
79
79
|
repr = 'custom';
|
|
80
80
|
}
|
|
81
81
|
break;
|
|
@@ -210,7 +210,7 @@ class BupkisAssertion {
|
|
|
210
210
|
}
|
|
211
211
|
else {
|
|
212
212
|
/* c8 ignore next */
|
|
213
|
-
throw new
|
|
213
|
+
throw new error_js_1.InvalidMetadataError(`Invalid metadata for slot ${slotIndex} with value ${(0, util_1.inspect)(rawArg)}`, { metadata: meta });
|
|
214
214
|
}
|
|
215
215
|
return true;
|
|
216
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion.js","sourceRoot":"","sources":["../../../src/assertion/assertion.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"assertion.js","sourceRoot":"","sources":["../../../src/assertion/assertion.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;AAEH,kDAAgC;AAChC,gDAAwB;AAExB,+BAA+B;AAC/B,+BAA2B;AAE3B,gDAAgD;AAChD,0CAAmE;AACnE,gDAAgD;AAWhD,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,kBAAkB,CAAC,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,EAAE,GAAG,cAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;AAEtE;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAI,OAAO,EAGjD,CAAC;AAEJ;;GAEG;AACH,MAAsB,eAAe;IASxB;IACA;IACA;IALF,EAAE,CAAS;IAEpB,YACW,KAAY,EACZ,KAAY,EACZ,IAAU;QAFV,UAAK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,CAAC,EAAE,CAAC;oBACnC,OAAO;wBACL,OAAO,EAAE,KAAK;qBACf,CAAC;gBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,oBAAoB;gBACpB,MAAM,IAAI,+BAAoB,CAC5B,6BAA6B,SAAS,eAAe,IAAA,cAAO,EAAC,MAAM,CAAC,EAAE,EACtE,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB,CAAC;YACJ,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACK,mBAAmB;QACzB,MAAM,QAAQ,GAAG,IAAA,cAAI,EAAC,GAAG,IAAI,EAAE,EAAE;YAC/B,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC;QAEH,qDAAqD;QACrD,2DAA2D;QAC3D,MAAM,SAAS,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAE/D,OAAO,GAAG,QAAQ,IAAI,SAAS,EAAE,CAAC;IACpC,CAAC;CACF;AA9OD,0CA8OC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAqBH,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAI9B;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,iBA6D7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,sBAsDlC,CAAC"}
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
70
|
exports.createAsyncAssertion = exports.createAssertion = void 0;
|
|
71
71
|
const v4_1 = require("zod/v4");
|
|
72
|
+
const error_js_1 = require("../error.js");
|
|
72
73
|
const guards_js_1 = require("../guards.js");
|
|
73
74
|
const assertion_async_js_1 = require("./assertion-async.js");
|
|
74
75
|
const assertion_sync_js_1 = require("./assertion-sync.js");
|
|
@@ -83,16 +84,16 @@ const slotify_js_1 = require("./slotify.js");
|
|
|
83
84
|
*/
|
|
84
85
|
const createAssertion = (parts, impl, metadata) => {
|
|
85
86
|
if (!Array.isArray(parts)) {
|
|
86
|
-
throw new
|
|
87
|
+
throw new error_js_1.AssertionImplementationError('First parameter must be an array');
|
|
87
88
|
}
|
|
88
89
|
if (parts.length === 0) {
|
|
89
|
-
throw new
|
|
90
|
+
throw new error_js_1.AssertionImplementationError('At least one value is required for an assertion');
|
|
90
91
|
}
|
|
91
92
|
if (!parts.every((part) => (0, guards_js_1.isString)(part) || Array.isArray(part) || (0, guards_js_1.isZodType)(part))) {
|
|
92
|
-
throw new
|
|
93
|
+
throw new error_js_1.AssertionImplementationError('All assertion parts must be strings or Zod schemas');
|
|
93
94
|
}
|
|
94
95
|
if (!impl) {
|
|
95
|
-
throw new
|
|
96
|
+
throw new error_js_1.AssertionImplementationError('An assertion implementation is required');
|
|
96
97
|
}
|
|
97
98
|
try {
|
|
98
99
|
const slots = (0, slotify_js_1.slotify)(parts);
|
|
@@ -113,11 +114,11 @@ const createAssertion = (parts, impl, metadata) => {
|
|
|
113
114
|
}
|
|
114
115
|
catch (err) {
|
|
115
116
|
if (err instanceof v4_1.z.ZodError) {
|
|
116
|
-
throw new
|
|
117
|
+
throw new error_js_1.AssertionImplementationError(`Failed to slotify assertion parts: ${v4_1.z.prettifyError(err)}`, { cause: err });
|
|
117
118
|
}
|
|
118
|
-
throw err;
|
|
119
|
+
throw new error_js_1.AssertionImplementationError(`Failed to slotify assertion parts: ${err}`, { cause: err });
|
|
119
120
|
}
|
|
120
|
-
throw new
|
|
121
|
+
throw new error_js_1.AssertionImplementationError('Assertion implementation must be a function, Zod schema or Zod schema factory');
|
|
121
122
|
};
|
|
122
123
|
exports.createAssertion = createAssertion;
|
|
123
124
|
/**
|
|
@@ -128,16 +129,16 @@ exports.createAssertion = createAssertion;
|
|
|
128
129
|
*/
|
|
129
130
|
const createAsyncAssertion = (parts, impl, metadata) => {
|
|
130
131
|
if (!Array.isArray(parts)) {
|
|
131
|
-
throw new
|
|
132
|
+
throw new error_js_1.AssertionImplementationError('First parameter must be an array');
|
|
132
133
|
}
|
|
133
134
|
if (parts.length === 0) {
|
|
134
|
-
throw new
|
|
135
|
+
throw new error_js_1.AssertionImplementationError('At least one value is required for an assertion');
|
|
135
136
|
}
|
|
136
137
|
if (!parts.every((part) => (0, guards_js_1.isString)(part) || Array.isArray(part) || (0, guards_js_1.isZodType)(part))) {
|
|
137
|
-
throw new
|
|
138
|
+
throw new error_js_1.AssertionImplementationError('All assertion parts must be strings or Zod schemas');
|
|
138
139
|
}
|
|
139
140
|
if (!impl) {
|
|
140
|
-
throw new
|
|
141
|
+
throw new error_js_1.AssertionImplementationError('An assertion implementation is required');
|
|
141
142
|
}
|
|
142
143
|
const slots = (0, slotify_js_1.slotify)(parts);
|
|
143
144
|
if ((0, guards_js_1.isZodType)(impl)) {
|
|
@@ -154,7 +155,7 @@ const createAsyncAssertion = (parts, impl, metadata) => {
|
|
|
154
155
|
}
|
|
155
156
|
return assertion;
|
|
156
157
|
}
|
|
157
|
-
throw new
|
|
158
|
+
throw new error_js_1.AssertionImplementationError('Assertion implementation must be a function, Zod schema or Zod schema factory');
|
|
158
159
|
};
|
|
159
160
|
exports.createAsyncAssertion = createAsyncAssertion;
|
|
160
161
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;;;AAEH,+BAA2B;AAS3B,4CAA+D;AAC/D,6DAG8B;AAC9B,2DAG6B;AAC7B,6DAI8B;AAC9B,iDAA2D;AAC3D,6CAAuC;AAEvC;;;;;GAKG;AACI,MAAM,eAAe,GAAsB,CAIhD,KAAY,EACZ,IAAU,EACV,QAA4B,EAC5B,EAAE;IACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/assertion/create.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;;;AAEH,+BAA2B;AAS3B,0CAA2D;AAC3D,4CAA+D;AAC/D,6DAG8B;AAC9B,2DAG6B;AAC7B,6DAI8B;AAC9B,iDAA2D;AAC3D,6CAAuC;AAEvC;;;;;GAKG;AACI,MAAM,eAAe,GAAsB,CAIhD,KAAY,EACZ,IAAU,EACV,QAA4B,EAC5B,EAAE;IACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,uCAA4B,CAAC,kCAAkC,CAAC,CAAC;IAC7E,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,uCAA4B,CACpC,iDAAiD,CAClD,CAAC;IACJ,CAAC;IACD,IACE,CAAC,KAAK,CAAC,KAAK,CACV,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,oBAAQ,EAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC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AAM,SAAS,GAAG,IAAI,iDAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,QAAQ,EAAE,CAAC;YACb,wCAAyB,CAAC,GAAG,CAC3B,SAAS,EACT,4CAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,CACxC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,uCAA4B,CACpC,+EAA+E,CAChF,CAAC;AACJ,CAAC,CAAC;AAtDW,QAAA,oBAAoB,wBAsD/B"}
|
|
@@ -211,7 +211,7 @@ export declare const promiseRejectWithErrorSatisfyingAssertion: import("../asser
|
|
|
211
211
|
*
|
|
212
212
|
* @group Parametric Assertions (Async)
|
|
213
213
|
*/
|
|
214
|
-
export declare const promiseFulfillWithValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (promise: PromiseLike<unknown>, param: any) => Promise<z.ZodError<
|
|
214
|
+
export declare const promiseFulfillWithValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<PromiseLike<unknown>, PromiseLike<unknown>>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (promise: PromiseLike<unknown>, param: any) => Promise<z.ZodError<any> | {
|
|
215
215
|
actual: unknown;
|
|
216
216
|
expect: string;
|
|
217
217
|
message: string;
|
|
@@ -242,7 +242,7 @@ export declare const promiseFulfillWithValueSatisfyingAssertion: import("../asse
|
|
|
242
242
|
*
|
|
243
243
|
* @group Parametric Assertions (Async)
|
|
244
244
|
*/
|
|
245
|
-
export declare const functionFulfillWithValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<z.ZodError<
|
|
245
|
+
export declare const functionFulfillWithValueSatisfyingAssertion: import("../assertion-types.js").AssertionFunctionAsync<readonly [z.ZodCustom<(...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown>, readonly ["to fulfill with value satisfying", "to resolve with value satisfying"], z.ZodAny], (subject: (...args: import("../../types.js").MutableOrReadonly<unknown[]>) => unknown, param: any) => Promise<z.ZodError<any> | {
|
|
246
246
|
actual: string;
|
|
247
247
|
expect: string;
|
|
248
248
|
message: string;
|