forked from jagregory/cognito-local
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupTests.ts
33 lines (27 loc) · 1.15 KB
/
setupTests.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
expect.extend({
jsonMatching(actual: any, expected: any) {
const pass = this.equals(JSON.parse(actual), expected);
expected.toString = function (this: any) {
return JSON.stringify(this);
}.bind(expected);
return {
pass,
message: () =>
`expected ${actual} to equal ${expected} when parsed as JSON`,
};
},
});
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
interface Expect {
jsonMatching(expected: any): any;
}
}
}
// "Payload": {"version":0,"callerContext":{"awsSdkVersion":"2.953.0","clientId":"clientId"},"region":"local","userPoolId":"userPoolId","triggerSource":"UserMigration_Authentication","request":{"userAttributes":{},"validationData":{},"password":"password"},"response":{},"userName":"username"}
// "Payload": {"version":0,"callerContext":{"awsSdkVersion":"2.953.0","clientId":"clientId"},"region":"local","userPoolId":"userPoolId","triggerSource":"UserMigration_Authentication","request":{"userAttributes":{},"validationData":{},"password":"password"},"response":{},"userName":"username"}
export {};
afterEach(() => {
jest.resetAllMocks();
});