-
Notifications
You must be signed in to change notification settings - Fork 672
Expand file tree
/
Copy pathsnapshots.integ.spec.ts
More file actions
46 lines (40 loc) · 1.23 KB
/
snapshots.integ.spec.ts
File metadata and controls
46 lines (40 loc) · 1.23 KB
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
// smithy-typescript generated code
import { SnapshotRunner } from "@smithy/snapshot-testing";
import { join } from "node:path";
import { describe, expect, test as it, vi } from "vitest";
import {
DescribeStream$,
DescribeStreamCommand,
DynamoDBStreamsClient,
GetRecords$,
GetRecordsCommand,
GetShardIterator$,
GetShardIteratorCommand,
ListStreams$,
ListStreamsCommand,
} from "../src";
vi.setSystemTime(new Date(946702799999));
const Client = DynamoDBStreamsClient;
const mode = (process.env.SNAPSHOT_MODE as "write" | "compare") ?? "write";
describe("DynamoDBStreamsClient" + ` (${mode})`, () => {
const runner = new SnapshotRunner({
snapshotDirPath: join(__dirname, "snapshots"),
Client,
mode,
testCase(caseName: string, run: () => Promise<void>) {
it(caseName, run);
},
assertions(caseName: string, expected: string, actual: string): Promise<void> {
expect(actual).toEqual(expected);
return Promise.resolve();
},
schemas:
new Map<any, any>([
[DescribeStream$, DescribeStreamCommand],
[GetRecords$, GetRecordsCommand],
[GetShardIterator$, GetShardIteratorCommand],
[ListStreams$, ListStreamsCommand],
]),
});
runner.run();
}, 30_000);