-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathbenchmarks.test.ts
82 lines (79 loc) · 2.5 KB
/
benchmarks.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { test, describe, expect } from 'vitest';
import { getRegisteredBenchmarks } from '../benchmarks';
import { cases } from '../cases';
// all cases need to be imported here because vitest cannot pick up dynamically
// imported `test` and `describe`
import '../cases/aeria';
import '../cases/ajv';
import '../cases/arktype';
import '../cases/banditypes';
import '../cases/bueno';
import '../cases/caketype';
import '../cases/class-validator';
import '../cases/cleaners';
import '../cases/computed-types';
import '../cases/decoders';
import '../cases/io-ts';
import '../cases/joi';
import '../cases/jointz';
import '../cases/json-decoder';
import '../cases/mol_data';
import '../cases/mojotech-json-type-validation';
import '../cases/mondrian-framework';
import '../cases/myzod';
import '../cases/ok-computer';
import '../cases/parse-dont-validate';
import '../cases/paseri';
import '../cases/pure-parse';
import '../cases/purify-ts';
import '../cases/r-assign';
import '../cases/rescript-schema';
import '../cases/rulr';
import '../cases/runtypes';
import '../cases/sapphire-shapeshift';
import '../cases/simple-runtypes';
import '../cases/sinclair-typebox-ahead-of-time';
import '../cases/sinclair-typebox-dynamic';
import '../cases/sinclair-typebox-just-in-time';
import '../cases/sinclair-typemap-valibot';
import '../cases/sinclair-typemap-zod';
import '../cases/spectypes';
import '../cases/stnl';
import '../cases/succulent';
import '../cases/superstruct';
import '../cases/suretype';
import '../cases/to-typed';
import '../cases/toi';
import '../cases/ts-interface-checker';
import '../cases/ts-json-validator';
import '../cases/ts-runtime-checks';
import '../cases/ts-utils';
import '../cases/tson';
import '../cases/typeofweb-schema';
import '../cases/typia';
import '../cases/unknownutil';
import '../cases/valibot';
import '../cases/valita';
import '../cases/vality';
import '../cases/yup';
import '../cases/zod';
import '../cases/deepkit';
import '../cases/effect-schema';
import '../cases/ts-auto-guard';
import '../cases/type-predicate-generator';
import '../cases/tiny-schema-validator';
import '../cases/jet-validators';
test('all cases must have been imported in tests', () => {
expect(
new Set<string>(
getRegisteredBenchmarks().flatMap(pair =>
pair[1].map(b => b.moduleName.split(' ')[0]),
),
).size,
).toBe(cases.length);
});
getRegisteredBenchmarks().forEach(([benchmarkId, benchmarkCases]) => {
describe(benchmarkId, () => {
benchmarkCases.forEach(c => c.test(describe, expect, test));
});
});