Skip to content

Commit

Permalink
chore(cognito): add auth failure test (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
eladcon authored Apr 2, 2024
1 parent 466bacc commit 78bcb28
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions cognito/lib.test.w
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,16 @@ test "access endpoint with cognito auth" {

expect.equal(res3.status, 200);
}

test "throw error when credentials are invalid" {
let var err = false;
auth.signUp("[email protected]", "This-is-my-test-99!");
auth.adminConfirmUser("[email protected]");
try {
let token = auth.initiateAuth("[email protected]", "not-my-password");
} catch {
err = true;
}

expect.equal(err, true);
}
4 changes: 2 additions & 2 deletions cognito/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cognito/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/cognito",
"version": "0.0.5",
"version": "0.0.6",
"description": "A wing library to work with AWS Cognito",
"author": {
"name": "Elad Cohen",
Expand Down

0 comments on commit 78bcb28

Please sign in to comment.