Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test get_user.test.ts:getUser() sometime fail #24

Open
asaf opened this issue Mar 19, 2023 · 0 comments
Open

test get_user.test.ts:getUser() sometime fail #24

asaf opened this issue Mar 19, 2023 · 0 comments

Comments

@asaf
Copy link
Contributor

asaf commented Mar 19, 2023

The test get_user.test.ts:getUser() sometimes fail, probably timing issues

 FAIL  test/client/get_user.test.ts (23.41 s)
  ● getUser › should get user

    expect(received).toBeUndefined()

    Received: {"__bearer": "eyJhbGciO...", "aud": ["client1"], "exp": 1679230461, "family_name": "[email protected]", "given_name": "Jared", "iat": 1679230460, "iss": "https://myorg.crossid.io/oauth2/", "name": "Jared Dunn", "nonce": "QlhhUGpBaS5wTHl3NlNkV2tDQ2ZBUEdCSnI1QndtMkxlfmdIMkx1VXNUV3MyRFNveHMzdjkwVVBUeFBhWENHTmJnYVNUQ2djSGg4QWR6MUVFeFRpWWVrYUotZi5FNHQuZDJkTkNmTlJ2ZXZV", "sub": "[email protected]"}

      29 |     await new Promise((res) => setTimeout(res, 1100))
      30 |     // expired
    > 31 |     expect(await cid.getUser()).toBeUndefined()
         |                                 ^
      32 |   })
      33 |
      34 |   // todo test for different aud / scopes

      at test/client/get_user.test.ts:31:33
      at step (test/client/get_user.test.ts:33:23)
      at Object.next (test/client/get_user.test.ts:14:53)
      at fulfilled (test/client/get_user.test.ts:5:58)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant