test(lsp): use explicit BDD markers in Windows spawn test

This commit is contained in:
YeonGyu-Kim 2026-02-14 14:03:06 +09:00
parent 422db236fe
commit 26ae666bc3

View File

@ -6,7 +6,7 @@ import { describe, expect, it, spyOn } from "bun:test"
describe("spawnProcess", () => { describe("spawnProcess", () => {
it("proceeds to node spawn on Windows when command is available", async () => { it("proceeds to node spawn on Windows when command is available", async () => {
// #given //#given
const originalPlatform = process.platform const originalPlatform = process.platform
const rootDir = mkdtempSync(join(tmpdir(), "lsp-process-test-")) const rootDir = mkdtempSync(join(tmpdir(), "lsp-process-test-"))
const childProcess = await import("node:child_process") const childProcess = await import("node:child_process")
@ -16,7 +16,7 @@ describe("spawnProcess", () => {
Object.defineProperty(process, "platform", { value: "win32" }) Object.defineProperty(process, "platform", { value: "win32" })
const { spawnProcess } = await import("./lsp-process") const { spawnProcess } = await import("./lsp-process")
// #when //#when
let result: ReturnType<typeof spawnProcess> | null = null let result: ReturnType<typeof spawnProcess> | null = null
expect(() => { expect(() => {
result = spawnProcess(["node", "--version"], { result = spawnProcess(["node", "--version"], {
@ -25,7 +25,7 @@ describe("spawnProcess", () => {
}) })
}).not.toThrow(/Binary 'node' not found/) }).not.toThrow(/Binary 'node' not found/)
// #then //#then
expect(nodeSpawnSpy).toHaveBeenCalled() expect(nodeSpawnSpy).toHaveBeenCalled()
expect(result).not.toBeNull() expect(result).not.toBeNull()
} finally { } finally {