diff --git a/cognito/README.md b/cognito/README.md index 6cf168cd..68a3cac1 100644 --- a/cognito/README.md +++ b/cognito/README.md @@ -15,6 +15,7 @@ npm i @winglibs/cognito ## Usage ```js +bring cloud; bring cognito; let api = new cloud.Api(); @@ -33,13 +34,17 @@ auth.get("/hello"); ### Wing Code ```js -auth.signUp("fakeId@monada.co", "This-is-my-test-99!"); -auth.adminConfirmUser("fakeId@monada.co"); -let token = auth.initiateAuth("fakeId@monada.co", "This-is-my-test-99!"); -let res = http.get("{api.url}/hello", headers: { - "Authorization": "Bearer {token}" -}); -expect.equal(res.status, 200); +bring expect; +bring http; +test "auth happy path" { + auth.signUp("fakeId@wing.cloud", "This-is-my-test-99!"); + auth.adminConfirmUser("fakeId@wing.cloud"); + let token = auth.initiateAuth("fakeId@wing.cloud", "This-is-my-test-99!"); + let res = http.get("{api.url}/hello", headers: { + "Authorization": "Bearer {token}" + }); + expect.equal(res.status, 200); +} ``` ### AWS CLI diff --git a/cognito/package.json b/cognito/package.json index dc79501d..95b8bc69 100644 --- a/cognito/package.json +++ b/cognito/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/cognito", - "version": "0.0.4", + "version": "0.0.5", "description": "A wing library to work with AWS Cognito", "author": { "name": "Elad Cohen",