forked from moltar/typescript-runtime-type-benchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmarks.test.ts
64 lines (61 loc) · 1.89 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
import { getRegisteredBenchmarks } from '../benchmarks';
import { cases } from '../cases';
// all cases need to be imported here because jest cannot pic up dynamically
// imported `test` and `describe`
import '../cases/ajv';
import '../cases/arktype';
import '../cases/bueno';
import '../cases/class-validator';
import '../cases/computed-types';
import '../cases/decoders';
import '../cases/io-ts';
import '../cases/jointz';
import '../cases/json-decoder';
import '../cases/mol_data';
import '../cases/mojotech-json-type-validation';
import '../cases/myzod';
import '../cases/ok-computer';
import '../cases/parse-dont-validate';
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/spectypes';
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';
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());
});
});