Skip to content

Commit 86206f2

Browse files
committed
Address comment
1 parent dc83405 commit 86206f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/src/test/testAuthUtil.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import { LanguageClientAuth } from '../auth/auth2'
1010
import { AuthUtil } from '../codewhisperer/util/authUtil'
1111

1212
export async function createTestAuthUtil() {
13-
sinon.restore()
14-
AuthUtil.destroy()
15-
1613
const encryptionKey = crypto.randomBytes(32)
1714

1815
const jwe = await new jose.CompactEncrypt(new TextEncoder().encode(JSON.stringify({ your: 'mock data' })))
@@ -42,5 +39,8 @@ export async function createTestAuthUtil() {
4239
encryptionKey,
4340
}
4441

42+
// Since AuthUtil is a singleton, we want to remove an existing instance before setting up a new one
43+
AuthUtil.destroy()
44+
4545
AuthUtil.create(mockLspAuth as LanguageClientAuth)
4646
}

0 commit comments

Comments
 (0)