test(shared): use unique temp dirs for legacy plugin warning
This commit is contained in:
@@ -1,13 +1,11 @@
|
|||||||
import { describe, expect, it } from "bun:test"
|
import { describe, expect, it } from "bun:test"
|
||||||
import { mkdirSync, rmSync, writeFileSync } from "node:fs"
|
import { mkdtempSync, rmSync, writeFileSync } from "node:fs"
|
||||||
import { tmpdir } from "node:os"
|
import { tmpdir } from "node:os"
|
||||||
import { join } from "node:path"
|
import { join } from "node:path"
|
||||||
import { checkForLegacyPluginEntry } from "./legacy-plugin-warning"
|
import { checkForLegacyPluginEntry } from "./legacy-plugin-warning"
|
||||||
|
|
||||||
function createTestConfigDir(): string {
|
function createTestConfigDir(): string {
|
||||||
const testConfigDir = join(tmpdir(), `omo-legacy-check-${Date.now()}-${Math.random().toString(36).slice(2)}`)
|
return mkdtempSync(join(tmpdir(), "omo-legacy-check-"))
|
||||||
mkdirSync(testConfigDir, { recursive: true })
|
|
||||||
return testConfigDir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanupTestConfigDir(testConfigDir: string): void {
|
function cleanupTestConfigDir(testConfigDir: string): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user