test: import real modules in contamination-prone tests

This commit is contained in:
YeonGyu-Kim
2026-04-04 19:41:11 +09:00
parent 051a39889d
commit b0f754f506
3 changed files with 15 additions and 3 deletions
+7 -1
View File
@@ -1,8 +1,14 @@
import { describe, expect, it, beforeEach, afterEach, mock } from "bun:test"
import { createHash, randomBytes } from "node:crypto"
import { McpOAuthProvider, generateCodeVerifier, generateCodeChallenge, buildAuthorizationUrl } from "./provider"
import type { OAuthTokenData } from "./storage"
const {
McpOAuthProvider,
generateCodeVerifier,
generateCodeChallenge,
buildAuthorizationUrl,
} = await import(new URL("./provider.ts", import.meta.url).href)
describe("McpOAuthProvider", () => {
describe("generateCodeVerifier", () => {
it("returns a base64url-encoded 32-byte random string", () => {