File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,4 +4,21 @@ import { TextEncoder, TextDecoder } from 'util'
44global . TextEncoder = TextEncoder as any
55global . TextDecoder = TextDecoder as any
66
7- fetchMock . enableMocks ( )
7+ fetchMock . enableMocks ( )
8+
9+ // @uvdsl /solid-oidc-client-browser uses `import.meta.url` (for its
10+ // SharedWorker URL), which jest/jsdom cannot evaluate. Stub the module
11+ // surface used by the adapter so SolidAuthnLogic can be unit-tested.
12+ jest . mock ( '@uvdsl/solid-oidc-client-browser' , ( ) => {
13+ class Session {
14+ isActive = false
15+ webId = undefined
16+ async login ( ) { }
17+ async logout ( ) { }
18+ async handleRedirectFromLogin ( ) { }
19+ async restore ( ) { }
20+ authFetch ( input : any , init ?: any ) { return fetch ( input , init ) }
21+ }
22+ class SessionIDB { }
23+ return { Session, SessionIDB }
24+ } , { virtual : true } )
You can’t perform that action at this time.
0 commit comments