forked from jagregory/cognito-local
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lambda): lambda triggers called with clientMetadata/validationData
All existing lambda invocations are now called with ClientMetadata and ValidationData where appropriate.
- Loading branch information
Showing
30 changed files
with
926 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,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(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.