iTwin / auth-clients

Auth Clients for the iTwin Platform
https://www.itwinjs.org/
MIT License
6 stars 3 forks source link

Functions for testing are not exported #258

Open a-gagnon opened 1 month ago

a-gagnon commented 1 month ago

Hi. I'm trying to remove all deep imports from my project, and that's currently impossible because none of the classes/functions for testing are exported from the @itwin/oidc-signin-tool package.

In the civil repo, we're using a subset of the functions/classes used in itwinjs-core integration tests:

getAccessTokenFromBackend
TestBrowserAuthorizationClientConfiguration
TestFrontendAuthorizationClient
TestUserCredentials
TestUsers

Would it be possible to export those, or provide an alternative to the above for testing?

ben-polinsky commented 1 month ago

Hello.

While these aren't exported from the barrel and are internal, they are exported from their respective modules. For now, can you try to access them like:

import { TestFrontendAuthorizationClient } from "@itwin/oidc-signin-tool/lib/cjs/frontend";

And we'll take another look as time permits?

a-gagnon commented 1 month ago

Hey Ben. We're already using the internal barrel file in our tests and that's fine for now.

I just wanted to file something to make sure it eventually gets fixed. No rush!

ben-polinsky commented 1 month ago

Sounds good - thanks.