test: import real modules in contamination-prone tests
This commit is contained in:
@@ -5,7 +5,10 @@ import { describe, expect, test } from "bun:test"
|
||||
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"
|
||||
import { tmpdir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { createConnectedProvidersCacheStore, findProviderModelMetadata } from "./connected-providers-cache"
|
||||
|
||||
const { createConnectedProvidersCacheStore, findProviderModelMetadata } = await import(
|
||||
new URL("./connected-providers-cache.ts", import.meta.url).href
|
||||
)
|
||||
|
||||
function createTestCacheContext() {
|
||||
const fakeUserCacheRoot = mkdtempSync(join(tmpdir(), "connected-providers-user-cache-"))
|
||||
|
||||
@@ -2,7 +2,10 @@ import { describe, expect, it } from "bun:test"
|
||||
import { mkdtempSync, rmSync, writeFileSync } from "node:fs"
|
||||
import { tmpdir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { checkForLegacyPluginEntry } from "./legacy-plugin-warning"
|
||||
|
||||
const { checkForLegacyPluginEntry } = await import(
|
||||
new URL("./legacy-plugin-warning.ts", import.meta.url).href
|
||||
)
|
||||
|
||||
function createTestConfigDir(): string {
|
||||
return mkdtempSync(join(tmpdir(), "omo-legacy-check-"))
|
||||
|
||||
Reference in New Issue
Block a user