@creative-introvert/tons-of-tests 2.1.0 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -37
- package/dist/cjs/Classify.js +1 -2
- package/dist/cjs/Classify.js.map +1 -1
- package/dist/cjs/RepositoryError.js +24 -33
- package/dist/cjs/RepositoryError.js.map +1 -1
- package/dist/cjs/Show.js +18 -0
- package/dist/cjs/Show.js.map +1 -1
- package/dist/cjs/Test.js +37 -2
- package/dist/cjs/Test.js.map +1 -1
- package/dist/cjs/Test.repository.js +8 -17
- package/dist/cjs/Test.repository.js.map +1 -1
- package/dist/cjs/TestRun.js +20 -0
- package/dist/cjs/TestRun.js.map +1 -0
- package/dist/cjs/TestValueError.js +23 -0
- package/dist/cjs/TestValueError.js.map +1 -0
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/Classify.js +1 -9
- package/dist/cjs/internal/Classify.js.map +1 -1
- package/dist/cjs/internal/Test.js +236 -93
- package/dist/cjs/internal/Test.js.map +1 -1
- package/dist/cjs/internal/Test.repository.sqlite.js +262 -357
- package/dist/cjs/internal/Test.repository.sqlite.js.map +1 -1
- package/dist/cjs/internal/Test.serialization.js +128 -0
- package/dist/cjs/internal/Test.serialization.js.map +1 -0
- package/dist/cjs/internal/common.js.map +1 -1
- package/dist/cjs/internal/stats.js +29 -1
- package/dist/cjs/internal/stats.js.map +1 -1
- package/dist/cjs/internal/summarize.js +143 -29
- package/dist/cjs/internal/summarize.js.map +1 -1
- package/dist/cjs/internal/test-repository-fixtures.js +31 -0
- package/dist/cjs/internal/test-repository-fixtures.js.map +1 -0
- package/dist/cjs/internal/test-repository-migrations.js +68 -0
- package/dist/cjs/internal/test-repository-migrations.js.map +1 -0
- package/dist/cjs/internal/test-result-stats.js +89 -0
- package/dist/cjs/internal/test-result-stats.js.map +1 -0
- package/dist/dts/Classify.d.ts +0 -1
- package/dist/dts/Classify.d.ts.map +1 -1
- package/dist/dts/RepositoryError.d.ts +19 -20
- package/dist/dts/RepositoryError.d.ts.map +1 -1
- package/dist/dts/Show.d.ts +5 -5
- package/dist/dts/Show.d.ts.map +1 -1
- package/dist/dts/Test.d.ts +120 -14
- package/dist/dts/Test.d.ts.map +1 -1
- package/dist/dts/Test.repository.d.ts +94 -8
- package/dist/dts/Test.repository.d.ts.map +1 -1
- package/dist/dts/TestRun.d.ts +18 -0
- package/dist/dts/TestRun.d.ts.map +1 -0
- package/dist/dts/TestValueError.d.ts +17 -0
- package/dist/dts/TestValueError.d.ts.map +1 -0
- package/dist/dts/index.d.ts +0 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/Classify.d.ts +0 -1
- package/dist/dts/internal/Classify.d.ts.map +1 -1
- package/dist/dts/internal/Test.d.ts +52 -30
- package/dist/dts/internal/Test.d.ts.map +1 -1
- package/dist/dts/internal/Test.repository.sqlite.d.ts +66 -12
- package/dist/dts/internal/Test.repository.sqlite.d.ts.map +1 -1
- package/dist/dts/internal/Test.serialization.d.ts +34 -0
- package/dist/dts/internal/Test.serialization.d.ts.map +1 -0
- package/dist/dts/internal/common.d.ts +1 -1
- package/dist/dts/internal/common.d.ts.map +1 -1
- package/dist/dts/internal/stats.d.ts +15 -1
- package/dist/dts/internal/stats.d.ts.map +1 -1
- package/dist/dts/internal/summarize.d.ts +39 -7
- package/dist/dts/internal/summarize.d.ts.map +1 -1
- package/dist/dts/internal/test-repository-fixtures.d.ts +22 -0
- package/dist/dts/internal/test-repository-fixtures.d.ts.map +1 -0
- package/dist/dts/internal/test-repository-migrations.d.ts +11 -0
- package/dist/dts/internal/test-repository-migrations.d.ts.map +1 -0
- package/dist/dts/internal/test-result-stats.d.ts +7 -0
- package/dist/dts/internal/test-result-stats.d.ts.map +1 -0
- package/dist/esm/Classify.js +0 -1
- package/dist/esm/Classify.js.map +1 -1
- package/dist/esm/RepositoryError.js +14 -29
- package/dist/esm/RepositoryError.js.map +1 -1
- package/dist/esm/Show.js +2 -2
- package/dist/esm/Show.js.map +1 -1
- package/dist/esm/Test.js +34 -1
- package/dist/esm/Test.js.map +1 -1
- package/dist/esm/Test.repository.js +7 -16
- package/dist/esm/Test.repository.js.map +1 -1
- package/dist/esm/TestRun.js +13 -0
- package/dist/esm/TestRun.js.map +1 -0
- package/dist/esm/TestValueError.js +16 -0
- package/dist/esm/TestValueError.js.map +1 -0
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/Classify.js +0 -7
- package/dist/esm/internal/Classify.js.map +1 -1
- package/dist/esm/internal/Test.js +232 -92
- package/dist/esm/internal/Test.js.map +1 -1
- package/dist/esm/internal/Test.repository.sqlite.js +261 -354
- package/dist/esm/internal/Test.repository.sqlite.js.map +1 -1
- package/dist/esm/internal/Test.serialization.js +119 -0
- package/dist/esm/internal/Test.serialization.js.map +1 -0
- package/dist/esm/internal/common.js.map +1 -1
- package/dist/esm/internal/stats.js +27 -0
- package/dist/esm/internal/stats.js.map +1 -1
- package/dist/esm/internal/summarize.js +143 -28
- package/dist/esm/internal/summarize.js.map +1 -1
- package/dist/esm/internal/test-repository-fixtures.js +25 -0
- package/dist/esm/internal/test-repository-fixtures.js.map +1 -0
- package/dist/esm/internal/test-repository-migrations.js +62 -0
- package/dist/esm/internal/test-repository-migrations.js.map +1 -0
- package/dist/esm/internal/test-result-stats.js +83 -0
- package/dist/esm/internal/test-result-stats.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/Test.repository.types.js +0 -14
- package/dist/cjs/Test.repository.types.js.map +0 -1
- package/dist/cjs/internal/lib/Schema.js +0 -14
- package/dist/cjs/internal/lib/Schema.js.map +0 -1
- package/dist/dts/Test.repository.types.d.ts +0 -62
- package/dist/dts/Test.repository.types.d.ts.map +0 -1
- package/dist/dts/internal/lib/Schema.d.ts +0 -4
- package/dist/dts/internal/lib/Schema.d.ts.map +0 -1
- package/dist/esm/Test.repository.types.js +0 -7
- package/dist/esm/Test.repository.types.js.map +0 -1
- package/dist/esm/internal/lib/Schema.js +0 -7
- package/dist/esm/internal/lib/Schema.js.map +0 -1
package/README.md
CHANGED
|
@@ -26,8 +26,8 @@ A specialized test runner for predictive functions, focusing on scenarios where
|
|
|
26
26
|
|
|
27
27
|
Use Node.js 24 or newer and Effect 4. The Effect packages in this repository
|
|
28
28
|
use the same exact version. The SQLite driver uses Node's built-in SQLite.
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
This release requires a fresh database. Set `dbPath` to a new file and run the
|
|
30
|
+
suite again. Old database formats are not upgraded automatically.
|
|
31
31
|
|
|
32
32
|
### Installation
|
|
33
33
|
|
|
@@ -47,7 +47,7 @@ Define your test suite:
|
|
|
47
47
|
// my-test-suite.ts
|
|
48
48
|
import {Classify} from '@creative-introvert/tons-of-tests';
|
|
49
49
|
import * as CLI from '@creative-introvert/tons-of-tests-cli';
|
|
50
|
-
import {Effect} from 'effect';
|
|
50
|
+
import {Effect, Schema} from 'effect';
|
|
51
51
|
|
|
52
52
|
const myFunction = (input: number) => Promise.resolve(input * 1.7);
|
|
53
53
|
const classify = Classify.makeClassify<number, number>({
|
|
@@ -58,6 +58,10 @@ const classify = Classify.makeClassify<number, number>({
|
|
|
58
58
|
CLI.run({
|
|
59
59
|
testSuite: {
|
|
60
60
|
name: 'with-cli-simple',
|
|
61
|
+
schemas: {
|
|
62
|
+
testCase: {input: Schema.Finite, expected: Schema.Finite},
|
|
63
|
+
evaluation: {result: Schema.Finite, expected: Schema.Finite},
|
|
64
|
+
},
|
|
61
65
|
testCases: [
|
|
62
66
|
{input: 0, expected: 0},
|
|
63
67
|
{input: 1, expected: 2},
|
|
@@ -76,9 +80,17 @@ CLI.run({
|
|
|
76
80
|
```
|
|
77
81
|
|
|
78
82
|
Omit `evaluate` to compare the whole output with the expected value using
|
|
79
|
-
`
|
|
80
|
-
`result
|
|
81
|
-
|
|
83
|
+
`Schema.toEquivalence`. Reuse the same schema instance for
|
|
84
|
+
`schemas.evaluation.result` and `schemas.evaluation.expected`. The default
|
|
85
|
+
evaluator returns one result with key `result`. It treats `null` and `undefined`
|
|
86
|
+
as missing values for classification.
|
|
87
|
+
|
|
88
|
+
`Classify.makeClassify` returns a label for one comparison. Use it inside
|
|
89
|
+
`evaluate` to choose other matching rules or compare values of different types.
|
|
90
|
+
|
|
91
|
+
The runner keeps the first case for each input/expected-value hash. It warns
|
|
92
|
+
and skips later duplicates before calling `program`, then continues the suite.
|
|
93
|
+
Tags do not change a case's identity; the first case's tags are kept.
|
|
82
94
|
|
|
83
95
|
`testCases` can also be an Effect `Stream`, which is useful for large or generated suites that are consumed lazily by the runner:
|
|
84
96
|
|
|
@@ -88,6 +100,10 @@ import {Stream} from 'effect';
|
|
|
88
100
|
CLI.run({
|
|
89
101
|
testSuite: {
|
|
90
102
|
name: 'with-cli-stream',
|
|
103
|
+
schemas: {
|
|
104
|
+
testCase: {input: Schema.Finite, expected: Schema.Finite},
|
|
105
|
+
evaluation: {result: Schema.Finite, expected: Schema.Finite},
|
|
106
|
+
},
|
|
91
107
|
testCases: Stream.fromIterable([
|
|
92
108
|
{input: 0, expected: 0},
|
|
93
109
|
{input: 1, expected: 2},
|
|
@@ -109,17 +125,19 @@ authority, need, and timeline:
|
|
|
109
125
|
|
|
110
126
|
```ts
|
|
111
127
|
import {Classify, type Test} from '@creative-introvert/tons-of-tests';
|
|
112
|
-
import {Array} from 'effect';
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
import {Array, Schema} from 'effect';
|
|
129
|
+
|
|
130
|
+
const Field = Schema.NullOr(Schema.String);
|
|
131
|
+
const Bant = Schema.Struct({
|
|
132
|
+
budget: Field,
|
|
133
|
+
authority: Field,
|
|
134
|
+
need: Field,
|
|
135
|
+
timeline: Field,
|
|
136
|
+
});
|
|
137
|
+
type Bant = typeof Bant.Type;
|
|
120
138
|
|
|
121
139
|
const fields = ['budget', 'authority', 'need', 'timeline'] as const;
|
|
122
|
-
const classify = Classify.makeClassify({isEqual:
|
|
140
|
+
const classify = Classify.makeClassify({isEqual: Schema.toEquivalence(Field)});
|
|
123
141
|
|
|
124
142
|
const evaluate: Test.Evaluate<Bant, Bant, string | null, string | null> = (
|
|
125
143
|
output,
|
|
@@ -168,32 +186,85 @@ The statistics count cases and results separately. Labels, precision, and recall
|
|
|
168
186
|
count visible results. Timing statistics count each visible case once, even when
|
|
169
187
|
it has several result rows.
|
|
170
188
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
189
|
+
This suite needs a schema for the whole BANT expectation and schemas for the
|
|
190
|
+
individual field values:
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
const schemas = {
|
|
194
|
+
testCase: {input: Schema.String, expected: Bant},
|
|
195
|
+
evaluation: {result: Field, expected: Field},
|
|
196
|
+
};
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Value Schemas
|
|
200
|
+
|
|
201
|
+
Every suite requires `schemas`. The fields describe the values used at each
|
|
202
|
+
stage:
|
|
203
|
+
|
|
204
|
+
| Field | Value |
|
|
205
|
+
| --- | --- |
|
|
206
|
+
| `testCase.input` | Original input passed to `program` and saved with each result. |
|
|
207
|
+
| `testCase.expected` | Whole expected value passed to `evaluate` and used in the case hash. |
|
|
208
|
+
| `evaluation.result` | Result returned by `evaluate`. |
|
|
209
|
+
| `evaluation.expected` | Expected value returned by `evaluate`. |
|
|
210
|
+
|
|
211
|
+
The runner derives JSON codecs with Effect's `Schema.toCodecJson`. Built-in
|
|
212
|
+
schemas such as `Schema.BigInt` and `Schema.Date` provide JSON encodings.
|
|
213
|
+
Custom codecs can choose other encodings. Their encoded and decoded types may
|
|
214
|
+
differ. Schemas must not require Effect services.
|
|
215
|
+
|
|
216
|
+
`program`, `evaluate`, and fresh results keep the original values. Saved values
|
|
217
|
+
are encoded and loaded values are decoded with the same schemas. The whole
|
|
218
|
+
program output needs no storage schema when `evaluate` selects smaller values.
|
|
219
|
+
|
|
220
|
+
Encodings must be deterministic. The runner rejects undeclared object fields
|
|
221
|
+
and checks that decoding the JSON text restores an equivalent value according
|
|
222
|
+
to `Schema.toEquivalence`. These checks run before hashing or saving. For
|
|
223
|
+
example, an untagged bigint/string union can encode both `123n` and `"123"` as
|
|
224
|
+
the same JSON string. Use an encoding that records which type it contains.
|
|
225
|
+
|
|
226
|
+
Case hashes cover the encoded original input and whole expected value.
|
|
227
|
+
Result IDs also cover the evaluation key, label, and encoded result values.
|
|
228
|
+
Object keys are sorted; array order remains significant. Changing an encoding
|
|
229
|
+
can change hashes. Existing data is not migrated.
|
|
230
|
+
|
|
231
|
+
Tables and visual diffs display encoded JSON. Comparisons between runs use
|
|
232
|
+
schema equality on decoded values. Saved labels are not re-evaluated.
|
|
175
233
|
|
|
176
|
-
|
|
234
|
+
Conversion failures use `Error.TestValueError`. It includes the suite,
|
|
235
|
+
one-based case number, evaluation key when available, field, operation, and
|
|
236
|
+
original `SchemaError` cause. A failed CLI execution stays incomplete and cannot
|
|
237
|
+
be committed or reused with `--cached`.
|
|
177
238
|
|
|
178
|
-
|
|
179
|
-
classifier and wrap its label in a result, as shown in the basic example:
|
|
239
|
+
Direct repository calls also require schemas:
|
|
180
240
|
|
|
181
241
|
```ts
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
242
|
+
yield* repository.withTestRun(
|
|
243
|
+
run,
|
|
244
|
+
repository.insertTestResults(results, run, schemas),
|
|
245
|
+
);
|
|
246
|
+
const saved = repository.getTestResultsStream(run, schemas);
|
|
185
247
|
```
|
|
186
248
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
result or expected-value shape and your schemas cannot read older values, use
|
|
193
|
-
a new suite name for the new shape.
|
|
249
|
+
`Show.summarize({testRun, schemas})` returns an Effect containing the table text.
|
|
250
|
+
`Show.prepareSummary(results, {schemas, suite})` prepares table chunks inside
|
|
251
|
+
`Effect.scoped`. Both report conversion failures in the Effect error channel.
|
|
252
|
+
The schema-free `Classify.defaultIsEqual` and `Test.makeSha256` exports have
|
|
253
|
+
been removed.
|
|
194
254
|
|
|
195
255
|
### CLI Commands
|
|
196
256
|
|
|
257
|
+
The CLI reads and compares results in batches. It writes formatted rows to a
|
|
258
|
+
temporary file, then reads them back to print the table with the correct column
|
|
259
|
+
widths. Timing statistics use temporary SQLite tables, including the exact
|
|
260
|
+
median. Temporary files and tables are removed after use or failure.
|
|
261
|
+
|
|
262
|
+
This avoids keeping both full runs and the full table text in JavaScript memory.
|
|
263
|
+
The runner still keeps one hash per distinct case to detect duplicates. Arrays
|
|
264
|
+
you supply as `testCases` also stay in memory; use a stream to read cases as
|
|
265
|
+
needed. Temporary storage grows with the report size. The existing commands,
|
|
266
|
+
flags, table layout, and statistics stay the same.
|
|
267
|
+
|
|
197
268
|
#### Summarize
|
|
198
269
|
|
|
199
270
|
```sh
|
|
@@ -231,16 +302,23 @@ or reduce the number of program calls. No matches produces an empty view;
|
|
|
231
302
|
|
|
232
303
|
#### Summarize From Cache
|
|
233
304
|
|
|
234
|
-
|
|
235
|
-
without re-running the program or evaluator.
|
|
236
|
-
|
|
237
|
-
|
|
305
|
+
After the whole suite finishes successfully, `--cached` reads its saved results
|
|
306
|
+
without re-running the program or evaluator. This also works for an empty
|
|
307
|
+
suite. If the previous attempt failed or was interrupted, the CLI clears its
|
|
308
|
+
partial results and runs the suite again.
|
|
309
|
+
|
|
310
|
+
Use the cache to inspect other keys without making another inference call:
|
|
238
311
|
|
|
239
312
|
```sh
|
|
240
313
|
pnpx tsx bant-suite.ts summarize --cached --keys budget,need
|
|
241
314
|
```
|
|
242
315
|
|
|
243
316
|
`diff --cached` behaves the same way for the current-run side of the diff.
|
|
317
|
+
The cache belongs to the suite name. It does not detect changes to the program
|
|
318
|
+
or test cases; omit `--cached` when you want to run them again.
|
|
319
|
+
|
|
320
|
+
After upgrading, use a fresh database and create a new baseline. See
|
|
321
|
+
[database setup](./MIGRATION_GUIDE_V1.md#database-setup).
|
|
244
322
|
|
|
245
323
|
#### Write Test Results
|
|
246
324
|
|
|
@@ -248,6 +326,10 @@ pnpx tsx bant-suite.ts summarize --cached --keys budget,need
|
|
|
248
326
|
pnpx tsx my-test-suite.ts commit
|
|
249
327
|
```
|
|
250
328
|
|
|
329
|
+
`commit` saves the current results as the baseline for later comparisons.
|
|
330
|
+
It rejects a tracked run that failed or is still running. Changing the
|
|
331
|
+
baseline and creating the next current run happen in one database transaction.
|
|
332
|
+
|
|
251
333
|
#### Diff
|
|
252
334
|
|
|
253
335
|
The diff command compares your current test results with previously committed results. This is useful when you've made changes to either:
|
|
@@ -334,6 +416,30 @@ CLI.effect(
|
|
|
334
416
|
);
|
|
335
417
|
```
|
|
336
418
|
|
|
419
|
+
Each `CLI.effect` call opens and closes its own database connection. To share
|
|
420
|
+
one repository across several commands, use `CLI.effectNoDeps` and provide
|
|
421
|
+
the services once around the whole program. This also lets an in-memory
|
|
422
|
+
database keep its results between commands:
|
|
423
|
+
|
|
424
|
+
```ts
|
|
425
|
+
import * as CLI from '@creative-introvert/tons-of-tests-cli';
|
|
426
|
+
import {NodeRuntime} from '@effect/platform-node';
|
|
427
|
+
import {Effect} from 'effect';
|
|
428
|
+
|
|
429
|
+
const config = {testSuite, dbPath: ':memory:'};
|
|
430
|
+
|
|
431
|
+
Effect.gen(function* () {
|
|
432
|
+
yield* CLI.effectNoDeps(config, ['node', 'script', 'summarize']);
|
|
433
|
+
yield* CLI.effectNoDeps(config, ['node', 'script', 'commit']);
|
|
434
|
+
}).pipe(
|
|
435
|
+
Effect.provide(CLI.buildLayer(config)),
|
|
436
|
+
NodeRuntime.runMain,
|
|
437
|
+
);
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
`effectNoDeps` uses the supplied platform services and `TestRepository`.
|
|
441
|
+
Its `config.dbPath` is only used if you pass the config to `buildLayer`.
|
|
442
|
+
|
|
337
443
|
If you need the last committed test-run hash from inside another script, use
|
|
338
444
|
the dedicated helper:
|
|
339
445
|
|
|
@@ -347,7 +453,7 @@ const hash = await CLI.getLastTestRunHash({
|
|
|
347
453
|
// hash: string | null
|
|
348
454
|
```
|
|
349
455
|
|
|
350
|
-
When you use `CLI.effect`, `diff --exit-on-diff` fails with a typed
|
|
456
|
+
When you use `CLI.effect` or `CLI.effectNoDeps`, `diff --exit-on-diff` fails with a typed
|
|
351
457
|
`DiffNonEmpty` error when the current run has visible diffs. Handle it with
|
|
352
458
|
`Effect.catchTag('DiffNonEmpty', handler)`; `error.count` gives the number of
|
|
353
459
|
visible changed results.
|
package/dist/cjs/Classify.js
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.values = exports.makeClassify = exports.defaultIsNil = exports.
|
|
6
|
+
exports.values = exports.makeClassify = exports.defaultIsNil = exports.Stats = exports.LabelSchema = void 0;
|
|
7
7
|
var _effect = /*#__PURE__*/require("effect");
|
|
8
8
|
var internal = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./internal/Classify.js"));
|
|
9
9
|
var cache;
|
|
10
10
|
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
11
11
|
const LabelSchema = exports.LabelSchema = internal.LabelSchema;
|
|
12
12
|
const values = exports.values = internal.values;
|
|
13
|
-
const defaultIsEqual = exports.defaultIsEqual = internal.defaultIsEqual;
|
|
14
13
|
const defaultIsNil = exports.defaultIsNil = internal.defaultIsNil;
|
|
15
14
|
const makeClassify = exports.makeClassify = internal.makeClassify;
|
|
16
15
|
/** Counts selected results; timing statistics count each selected case once. */
|
package/dist/cjs/Classify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Classify.js","names":["_effect","require","internal","_interopRequireWildcard","cache","e","t","__esModule","r","c","a","Object","defineProperty","n","__proto__","default","WeakMap","has","get","set","hasOwnProperty","call","getOwnPropertyDescriptor","LabelSchema","exports","values","
|
|
1
|
+
{"version":3,"file":"Classify.js","names":["_effect","require","internal","_interopRequireWildcard","cache","e","t","__esModule","r","c","a","Object","defineProperty","n","__proto__","default","WeakMap","has","get","set","hasOwnProperty","call","getOwnPropertyDescriptor","LabelSchema","exports","values","defaultIsNil","makeClassify","Stats","Schema","Class","TP","Finite","TN","FP","FN","total","testCases","Int","precision","recall","timeMin","Option","timeMax","timeMedian","timeMean","empty","none"],"sources":["../../src/Classify.ts"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
|
|
@@ -3,42 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.TestRunNotFound = exports.TestRunNotCreated = exports.TestRunIncomplete = exports.TestBaselineNotFound = void 0;
|
|
7
|
+
Object.defineProperty(exports, "TestValueError", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _TestValueError.TestValueError;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
8
13
|
var _effect = /*#__PURE__*/require("effect");
|
|
9
|
-
|
|
10
|
-
class RepositoryQueryError extends /*#__PURE__*/_effect.Schema.TaggedError()('RepositoryQueryError', {
|
|
11
|
-
operation: _effect.Schema.String,
|
|
12
|
-
cause: /*#__PURE__*/_effect.Schema.instanceOf(_SqlError.SqlError)
|
|
13
|
-
}) {
|
|
14
|
-
static fromSql = operation => cause => new RepositoryQueryError({
|
|
15
|
-
operation,
|
|
16
|
-
cause
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
exports.RepositoryQueryError = RepositoryQueryError;
|
|
20
|
-
class RepositoryWriteError extends /*#__PURE__*/_effect.Schema.TaggedError()('RepositoryWriteError', {
|
|
21
|
-
operation: _effect.Schema.String,
|
|
22
|
-
cause: SqlCause
|
|
23
|
-
}) {
|
|
24
|
-
static from = operation => cause => new RepositoryWriteError({
|
|
25
|
-
operation,
|
|
26
|
-
cause
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
exports.RepositoryWriteError = RepositoryWriteError;
|
|
30
|
-
class RepositoryDecodeError extends /*#__PURE__*/_effect.Schema.TaggedError()('RepositoryDecodeError', {
|
|
31
|
-
operation: _effect.Schema.String,
|
|
32
|
-
cause: /*#__PURE__*/_effect.Schema.instanceOf(_effect.Schema.SchemaError)
|
|
33
|
-
}) {
|
|
34
|
-
static from = operation => cause => new RepositoryDecodeError({
|
|
35
|
-
operation,
|
|
36
|
-
cause
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
exports.RepositoryDecodeError = RepositoryDecodeError;
|
|
14
|
+
var _TestValueError = /*#__PURE__*/require("./TestValueError.js");
|
|
40
15
|
class TestRunNotCreated extends /*#__PURE__*/_effect.Schema.TaggedError()('TestRunNotCreated', {
|
|
41
16
|
testSuiteName: _effect.Schema.String
|
|
42
17
|
}) {}
|
|
18
|
+
/** A complete saved run is required for this operation. */
|
|
43
19
|
exports.TestRunNotCreated = TestRunNotCreated;
|
|
20
|
+
class TestRunIncomplete extends /*#__PURE__*/_effect.Schema.TaggedError()('TestRunIncomplete', {
|
|
21
|
+
testSuiteName: _effect.Schema.String,
|
|
22
|
+
testRunId: _effect.Schema.Int,
|
|
23
|
+
variant: _effect.Schema.String
|
|
24
|
+
}) {}
|
|
25
|
+
exports.TestRunIncomplete = TestRunIncomplete;
|
|
26
|
+
class TestRunNotFound extends /*#__PURE__*/_effect.Schema.TaggedError()('TestRunNotFound', {
|
|
27
|
+
testRunId: _effect.Schema.Int
|
|
28
|
+
}) {}
|
|
29
|
+
exports.TestRunNotFound = TestRunNotFound;
|
|
30
|
+
class TestBaselineNotFound extends /*#__PURE__*/_effect.Schema.TaggedError()('TestBaselineNotFound', {
|
|
31
|
+
testSuiteName: _effect.Schema.String,
|
|
32
|
+
variant: _effect.Schema.String
|
|
33
|
+
}) {}
|
|
34
|
+
exports.TestBaselineNotFound = TestBaselineNotFound;
|
|
44
35
|
//# sourceMappingURL=RepositoryError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepositoryError.js","names":["
|
|
1
|
+
{"version":3,"file":"RepositoryError.js","names":["_effect","require","_TestValueError","TestRunNotCreated","Schema","TaggedError","testSuiteName","String","exports","TestRunIncomplete","testRunId","Int","variant","TestRunNotFound","TestBaselineNotFound"],"sources":["../../src/RepositoryError.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AACA,IAAAA,OAAA,gBAAAC,OAAA;AAGA,IAAAC,eAAA,gBAAAD,OAAA;AAEM,MAAOE,iBAAkB,sBAAQC,cAAM,CAACC,WAAW,EAGtD,CAAC,mBAAmB,EAAE;EAACC,aAAa,EAAEF,cAAM,CAACG;AAAM,CAAC,CAAC;AAExD;AAAAC,OAAA,CAAAL,iBAAA,GAAAA,iBAAA;AACM,MAAOM,iBAAkB,sBAAQL,cAAM,CAACC,WAAW,EAGtD,CAAC,mBAAmB,EAAE;EACrBC,aAAa,EAAEF,cAAM,CAACG,MAAM;EAC5BG,SAAS,EAAEN,cAAM,CAACO,GAAG;EACrBC,OAAO,EAAER,cAAM,CAACG;CACnB,CAAC;AAAGC,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAEC,MAAOI,eAAgB,sBAAQT,cAAM,CAACC,WAAW,EAGpD,CAAC,iBAAiB,EAAE;EAACK,SAAS,EAAEN,cAAM,CAACO;AAAG,CAAC,CAAC;AAAGH,OAAA,CAAAK,eAAA,GAAAA,eAAA;AAE5C,MAAOC,oBAAqB,sBAAQV,cAAM,CAACC,WAAW,EAGzD,CAAC,sBAAsB,EAAE;EACxBC,aAAa,EAAEF,cAAM,CAACG,MAAM;EAC5BK,OAAO,EAAER,cAAM,CAACG;CACnB,CAAC;AAAGC,OAAA,CAAAM,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/dist/cjs/Show.js
CHANGED
|
@@ -9,6 +9,24 @@ Object.defineProperty(exports, "diff", {
|
|
|
9
9
|
return _diff.showDiff;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "prepareComparison", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _summarize.prepareComparison;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "prepareSummary", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _summarize.prepareSummary;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "runSummaries", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _stats.showRunSummaries;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
12
30
|
Object.defineProperty(exports, "stats", {
|
|
13
31
|
enumerable: true,
|
|
14
32
|
get: function () {
|
package/dist/cjs/Show.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Show.js","names":["_diff","require","_stats","_summarize"],"sources":["../../src/Show.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"Show.js","names":["_diff","require","_stats","_summarize"],"sources":["../../src/Show.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAAA,KAAA,gBAAAC,OAAA;AACA,IAAAC,MAAA,gBAAAD,OAAA;AAIA,IAAAE,UAAA,gBAAAF,OAAA","ignoreList":[]}
|
package/dist/cjs/Test.js
CHANGED
|
@@ -3,13 +3,48 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.summarizeRun = exports.selectVariant = exports.runCollectRecord = exports.resultKey = exports.filterResults = exports.diff = exports.compareRuns = exports.all = exports.TestVariantRequired = exports.TestVariantNotFound = void 0;
|
|
7
|
+
var _effect = /*#__PURE__*/require("effect");
|
|
7
8
|
var internal = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./internal/Test.js"));
|
|
8
9
|
var cache;
|
|
9
10
|
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
11
|
+
class TestVariantRequired extends /*#__PURE__*/_effect.Schema.TaggedError()('TestVariantRequired', {
|
|
12
|
+
testSuiteName: _effect.Schema.String
|
|
13
|
+
}) {}
|
|
14
|
+
exports.TestVariantRequired = TestVariantRequired;
|
|
15
|
+
class TestVariantNotFound extends /*#__PURE__*/_effect.Schema.TaggedError()('TestVariantNotFound', {
|
|
16
|
+
testSuiteName: _effect.Schema.String,
|
|
17
|
+
variant: _effect.Schema.String
|
|
18
|
+
}) {}
|
|
19
|
+
/** Selects a program without running it or requiring its services. */
|
|
20
|
+
exports.TestVariantNotFound = TestVariantNotFound;
|
|
21
|
+
const selectVariant = exports.selectVariant = internal.selectVariant;
|
|
22
|
+
/**
|
|
23
|
+
* Runs only the selected program. Its error and service types include every
|
|
24
|
+
* configured program and the case stream, even when the variant ID is a literal.
|
|
25
|
+
*/
|
|
10
26
|
const all = exports.all = internal.all;
|
|
27
|
+
/**
|
|
28
|
+
* Compares complete saved runs without evaluating again. The shared codecs must
|
|
29
|
+
* decode both runs and require no Effect services. Callers decide whether comparing
|
|
30
|
+
* different suites or program versions is meaningful.
|
|
31
|
+
*
|
|
32
|
+
* Results match by case hash and evaluation key. A match changes when its label
|
|
33
|
+
* or evaluated values change. Rows follow `to` order, followed by rows found only
|
|
34
|
+
* in `from`, in `from` order. Empty complete runs are valid comparison endpoints.
|
|
35
|
+
* Resolve missing baselines before calling; both endpoints must be saved runs.
|
|
36
|
+
* Incompatible codecs fail with `TestValueError`, which names the saved suite.
|
|
37
|
+
*/
|
|
38
|
+
const compareRuns = exports.compareRuns = internal.compareRuns;
|
|
39
|
+
/**
|
|
40
|
+
* Summarizes all matching results in a complete saved run. Each case contributes
|
|
41
|
+
* its timing once. Empty complete runs have zero counts and no timing values.
|
|
42
|
+
* The shared codecs must still read that run. The caller decides whether the
|
|
43
|
+
* stored values still have the same meaning. Resolve a missing baseline before
|
|
44
|
+
* calling; it differs from an empty run.
|
|
45
|
+
*/
|
|
46
|
+
const summarizeRun = exports.summarizeRun = internal.summarizeRun;
|
|
11
47
|
const diff = exports.diff = internal.diff;
|
|
12
|
-
const makeSha256 = exports.makeSha256 = internal.makeSha256;
|
|
13
48
|
/** Builds the lookup key for one evaluation within its original test case. */
|
|
14
49
|
const resultKey = exports.resultKey = internal.resultKey;
|
|
15
50
|
const runCollectRecord = exports.runCollectRecord = internal.runCollectRecord;
|
package/dist/cjs/Test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Test.js","names":["
|
|
1
|
+
{"version":3,"file":"Test.js","names":["_effect","require","internal","_interopRequireWildcard","cache","e","t","__esModule","r","c","a","Object","defineProperty","n","__proto__","default","WeakMap","has","get","set","hasOwnProperty","call","getOwnPropertyDescriptor","TestVariantRequired","Schema","TaggedError","testSuiteName","String","exports","TestVariantNotFound","variant","selectVariant","all","compareRuns","summarizeRun","diff","resultKey","runCollectRecord","filterResults"],"sources":["../../src/Test.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,gBAAAC,OAAA;AASA,IAAAC,QAAA,gBAAAC,uBAAA,cAAAF,OAAA;AAA+C,IAAAG,KAAA;AAAA,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAE,UAAA,SAAAF,CAAA,MAAAG,CAAA,EAAAC,CAAA,EAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,QAAAM,MAAA,CAAAN,CAAA,MAAAA,CAAA,SAAAQ,CAAA,MAAAT,KAAA,yBAAAY,OAAA,KAAAZ,KAAA,OAAAY,OAAA,KAAAZ,KAAA,QAAAA,KAAA,CAAAa,GAAA,CAAAZ,CAAA,UAAAD,KAAA,CAAAc,GAAA,CAAAb,CAAA,GAAAD,KAAA,CAAAe,GAAA,CAAAd,CAAA,EAAAQ,CAAA,UAAAJ,CAAA,IAAAJ,CAAA,gBAAAI,CAAA,OAAAW,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAI,CAAA,OAAAD,CAAA,GAAAE,CAAA,IAAAC,MAAA,CAAAW,wBAAA,CAAAjB,CAAA,EAAAI,CAAA,OAAAD,CAAA,CAAAU,GAAA,IAAAV,CAAA,CAAAW,GAAA,IAAAT,CAAA,CAAAG,CAAA,EAAAJ,CAAA,EAAAD,CAAA,IAAAK,CAAA,CAAAJ,CAAA,IAAAJ,CAAA,CAAAI,CAAA,WAAAI,CAAA;AA2EzC,MAAOU,mBAAoB,sBAAQC,cAAM,CAACC,WAAW,EAGxD,CAAC,qBAAqB,EAAE;EAACC,aAAa,EAAEF,cAAM,CAACG;AAAM,CAAC,CAAC;AAAGC,OAAA,CAAAL,mBAAA,GAAAA,mBAAA;AAEvD,MAAOM,mBAAoB,sBAAQL,cAAM,CAACC,WAAW,EAGxD,CAAC,qBAAqB,EAAE;EACvBC,aAAa,EAAEF,cAAM,CAACG,MAAM;EAC5BG,OAAO,EAAEN,cAAM,CAACG;CACnB,CAAC;AAqGF;AAAAC,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AACO,MAAME,aAAa,GAAAH,OAAA,CAAAG,aAAA,GAAG7B,QAAQ,CAAC6B,aAAa;AAEnD;;;;AAIO,MAAMC,GAAG,GAAAJ,OAAA,CAAAI,GAAA,GAAG9B,QAAQ,CAAC8B,GAAG;AAC/B;;;;;;;;;;;AAWO,MAAMC,WAAW,GAAAL,OAAA,CAAAK,WAAA,GAAG/B,QAAQ,CAAC+B,WAAW;AAC/C;;;;;;;AAOO,MAAMC,YAAY,GAAAN,OAAA,CAAAM,YAAA,GAAGhC,QAAQ,CAACgC,YAAY;AAC1C,MAAMC,IAAI,GAAAP,OAAA,CAAAO,IAAA,GAAGjC,QAAQ,CAACiC,IAAI;AACjC;AACO,MAAMC,SAAS,GAAAR,OAAA,CAAAQ,SAAA,GAAGlC,QAAQ,CAACkC,SAAS;AACpC,MAAMC,gBAAgB,GAAAT,OAAA,CAAAS,gBAAA,GAAGnC,QAAQ,CAACmC,gBAAgB;AACzD;AACO,MAAMC,aAAa,GAAAV,OAAA,CAAAU,aAAA,GAAGpC,QAAQ,CAACoC,aAAa","ignoreList":[]}
|
|
@@ -7,34 +7,25 @@ exports.TestRepository = void 0;
|
|
|
7
7
|
Object.defineProperty(exports, "TestRun", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
10
|
-
return
|
|
10
|
+
return _TestRun.TestRun;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
var Sqlite = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@effect/sql-sqlite-node"));
|
|
14
14
|
var _effect = /*#__PURE__*/require("effect");
|
|
15
15
|
var _TestRepositorySqlite = /*#__PURE__*/require("./internal/Test.repository.sqlite.js");
|
|
16
|
-
var
|
|
16
|
+
var _TestRun = /*#__PURE__*/require("./TestRun.js");
|
|
17
17
|
var cache;
|
|
18
18
|
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}));
|
|
22
|
-
let testLayerCache;
|
|
23
|
-
class TestRepository extends /*#__PURE__*/_effect.Context.Service()('TestRepository') {
|
|
24
|
-
// Lazy getters: makeTestRepository lives in an internal module that has
|
|
25
|
-
// its own import edge back here, so we evaluate these at access time
|
|
26
|
-
// rather than at class definition time to avoid the circular init order.
|
|
27
|
-
static get Live() {
|
|
28
|
-
return _effect.Layer.effect(this, _TestRepositorySqlite.makeTestRepository);
|
|
29
|
-
}
|
|
19
|
+
class TestRepository extends /*#__PURE__*/_effect.Context.Service()('@creative-introvert/tons-of-tests/TestRepository') {
|
|
20
|
+
static layerNoDeps = /*#__PURE__*/_effect.Layer.effect(this, _TestRepositorySqlite.makeTestRepository);
|
|
30
21
|
static layer(dbPath) {
|
|
31
|
-
return _effect.Layer.provide(this.
|
|
22
|
+
return _effect.Layer.provide(this.layerNoDeps, Sqlite.SqliteClient.layer({
|
|
32
23
|
filename: dbPath
|
|
33
24
|
}));
|
|
34
25
|
}
|
|
35
|
-
static
|
|
36
|
-
|
|
37
|
-
}
|
|
26
|
+
static TestLayer = /*#__PURE__*/_effect.Layer.provideMerge(this.layerNoDeps, /*#__PURE__*/Sqlite.SqliteClient.layer({
|
|
27
|
+
filename: ':memory:'
|
|
28
|
+
}));
|
|
38
29
|
}
|
|
39
30
|
exports.TestRepository = TestRepository;
|
|
40
31
|
//# sourceMappingURL=Test.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Test.repository.js","names":["Sqlite","_interopRequireWildcard","require","_effect","_TestRepositorySqlite","
|
|
1
|
+
{"version":3,"file":"Test.repository.js","names":["Sqlite","_interopRequireWildcard","require","_effect","_TestRepositorySqlite","_TestRun","cache","e","t","__esModule","r","c","a","Object","defineProperty","n","__proto__","default","WeakMap","has","get","set","hasOwnProperty","call","getOwnPropertyDescriptor","TestRepository","Context","Service","layerNoDeps","Layer","effect","makeTestRepository","layer","dbPath","provide","SqliteClient","filename","TestLayer","provideMerge","exports"],"sources":["../../src/Test.repository.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,gBAAAC,uBAAA,cAAAC,OAAA;AACA,IAAAC,OAAA,gBAAAD,OAAA;AAUA,IAAAE,qBAAA,gBAAAF,OAAA;AAKA,IAAAG,QAAA,gBAAAH,OAAA;AAAqC,IAAAI,KAAA;AAAA,SAAAL,wBAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAE,UAAA,SAAAF,CAAA,MAAAG,CAAA,EAAAC,CAAA,EAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,QAAAM,MAAA,CAAAN,CAAA,MAAAA,CAAA,SAAAQ,CAAA,MAAAT,KAAA,yBAAAY,OAAA,KAAAZ,KAAA,OAAAY,OAAA,KAAAZ,KAAA,QAAAA,KAAA,CAAAa,GAAA,CAAAZ,CAAA,UAAAD,KAAA,CAAAc,GAAA,CAAAb,CAAA,GAAAD,KAAA,CAAAe,GAAA,CAAAd,CAAA,EAAAQ,CAAA,UAAAJ,CAAA,IAAAJ,CAAA,gBAAAI,CAAA,OAAAW,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAI,CAAA,OAAAD,CAAA,GAAAE,CAAA,IAAAC,MAAA,CAAAW,wBAAA,CAAAjB,CAAA,EAAAI,CAAA,OAAAD,CAAA,CAAAU,GAAA,IAAAV,CAAA,CAAAW,GAAA,IAAAT,CAAA,CAAAG,CAAA,EAAAJ,CAAA,EAAAD,CAAA,IAAAK,CAAA,CAAAJ,CAAA,IAAAJ,CAAA,CAAAI,CAAA,WAAAI,CAAA;AA0G/B,MAAOU,cAAe,sBAAQC,eAAO,CAACC,OAAO,EAGhD,CAAC,kDAAkD,CAAC;EACnD,OAAgBC,WAAW,gBAAGC,aAAK,CAACC,MAAM,CAAC,IAAI,EAAEC,wCAAkB,CAAC;EAEpE,OAAOC,KAAKA,CAACC,MAAc;IACvB,OAAOJ,aAAK,CAACK,OAAO,CAChB,IAAI,CAACN,WAAW,EAChB5B,MAAM,CAACmC,YAAY,CAACH,KAAK,CAAC;MAACI,QAAQ,EAAEH;IAAM,CAAC,CAAC,CAChD;EACL;EAEA,OAAgBI,SAAS,gBAAGR,aAAK,CAACS,YAAY,CAC1C,IAAI,CAACV,WAAW,eAChB5B,MAAM,CAACmC,YAAY,CAACH,KAAK,CAAC;IAACI,QAAQ,EAAE;EAAU,CAAC,CAAC,CACpD;;AACJG,OAAA,CAAAd,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TestRun = void 0;
|
|
7
|
+
var _effect = /*#__PURE__*/require("effect");
|
|
8
|
+
/**
|
|
9
|
+
* One saved execution of a suite variant. Results remain available after its
|
|
10
|
+
* program changes or is removed. `Complete` and `Failed` runs cannot be changed.
|
|
11
|
+
* Committing a complete run changes only its variant's baseline pointer.
|
|
12
|
+
*/
|
|
13
|
+
class TestRun extends /*#__PURE__*/_effect.Schema.Class('TestRun')({
|
|
14
|
+
id: _effect.Schema.Int,
|
|
15
|
+
name: _effect.Schema.String,
|
|
16
|
+
variant: _effect.Schema.String,
|
|
17
|
+
state: /*#__PURE__*/_effect.Schema.Literals(['Running', 'Complete', 'Failed'])
|
|
18
|
+
}) {}
|
|
19
|
+
exports.TestRun = TestRun;
|
|
20
|
+
//# sourceMappingURL=TestRun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestRun.js","names":["_effect","require","TestRun","Schema","Class","id","Int","name","String","variant","state","Literals","exports"],"sources":["../../src/TestRun.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,gBAAAC,OAAA;AAEA;;;;;AAKM,MAAOC,OAAQ,sBAAQC,cAAM,CAACC,KAAK,CAGvC,SAAS,CAAC,CAAC;EACTC,EAAE,EAAEF,cAAM,CAACG,GAAG;EACdC,IAAI,EAAEJ,cAAM,CAACK,MAAM;EACnBC,OAAO,EAAEN,cAAM,CAACK,MAAM;EACtBE,KAAK,eAAEP,cAAM,CAACQ,QAAQ,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC;CAC3D,CAAC;AAAGC,OAAA,CAAAV,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TestValueError = void 0;
|
|
7
|
+
var _effect = /*#__PURE__*/require("effect");
|
|
8
|
+
/** A suite value could not be converted without losing information. */
|
|
9
|
+
class TestValueError extends /*#__PURE__*/_effect.Schema.TaggedError()('TestValueError', {
|
|
10
|
+
suite: _effect.Schema.String,
|
|
11
|
+
caseNumber: _effect.Schema.Int,
|
|
12
|
+
key: /*#__PURE__*/_effect.Schema.optionalKey(_effect.Schema.String),
|
|
13
|
+
field: /*#__PURE__*/_effect.Schema.Literals(['testCase.input', 'testCase.expected', 'evaluation.result', 'evaluation.expected']),
|
|
14
|
+
operation: /*#__PURE__*/_effect.Schema.Literals(['encode', 'decode', 'roundTrip']),
|
|
15
|
+
cause: /*#__PURE__*/_effect.Schema.instanceOf(_effect.Schema.SchemaError)
|
|
16
|
+
}) {
|
|
17
|
+
get message() {
|
|
18
|
+
const key = this.key === undefined ? '' : `, result ${this.key}`;
|
|
19
|
+
return `${this.suite}, case ${this.caseNumber}${key}, ${this.field} (${this.operation}): ${this.cause.message}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.TestValueError = TestValueError;
|
|
23
|
+
//# sourceMappingURL=TestValueError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestValueError.js","names":["_effect","require","TestValueError","Schema","TaggedError","suite","String","caseNumber","Int","key","optionalKey","field","Literals","operation","cause","instanceOf","SchemaError","message","undefined","exports"],"sources":["../../src/TestValueError.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,gBAAAC,OAAA;AAEA;AACM,MAAOC,cAAe,sBAAQC,cAAM,CAACC,WAAW,EAGnD,CAAC,gBAAgB,EAAE;EAClBC,KAAK,EAAEF,cAAM,CAACG,MAAM;EACpBC,UAAU,EAAEJ,cAAM,CAACK,GAAG;EACtBC,GAAG,eAAEN,cAAM,CAACO,WAAW,CAACP,cAAM,CAACG,MAAM,CAAC;EACtCK,KAAK,eAAER,cAAM,CAACS,QAAQ,CAAC,CACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,CACxB,CAAC;EACFC,SAAS,eAAEV,cAAM,CAACS,QAAQ,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;EAC7DE,KAAK,eAAEX,cAAM,CAACY,UAAU,CAACZ,cAAM,CAACa,WAAW;CAC9C,CAAC;EACE,IAAaC,OAAOA,CAAA;IAChB,MAAMR,GAAG,GAAG,IAAI,CAACA,GAAG,KAAKS,SAAS,GAAG,EAAE,GAAG,YAAY,IAAI,CAACT,GAAG,EAAE;IAChE,OAAO,GAAG,IAAI,CAACJ,KAAK,UAAU,IAAI,CAACE,UAAU,GAAGE,GAAG,KAAK,IAAI,CAACE,KAAK,KAAK,IAAI,CAACE,SAAS,MAAM,IAAI,CAACC,KAAK,CAACG,OAAO,EAAE;EACnH;;AACHE,OAAA,CAAAjB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TestRepository = exports.Test = exports.Show = exports.Error = exports.DisplayConfig = exports.Classify = void 0;
|
|
7
|
-
Object.defineProperty(exports, "pack", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _pack.pack;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
7
|
var _Classify = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./Classify.js"));
|
|
14
8
|
exports.Classify = _Classify;
|
|
15
9
|
var _DisplayConfig = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./DisplayConfig.js"));
|
|
16
10
|
exports.DisplayConfig = _DisplayConfig;
|
|
17
11
|
var _Error = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./RepositoryError.js"));
|
|
18
12
|
exports.Error = _Error;
|
|
19
|
-
var _pack = /*#__PURE__*/require("./internal/pack.js");
|
|
20
13
|
var _Show = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./Show.js"));
|
|
21
14
|
exports.Show = _Show;
|
|
22
15
|
var _Test = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./Test.js"));
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"","ignoreList":[]}
|