diff --git a/tests/acceptance/setup/tomlCommentPreservationCli.test.ts b/tests/acceptance/setup/tomlCommentPreservationCli.test.ts index c4c51c35d65..ac15e45e35e 100644 --- a/tests/acceptance/setup/tomlCommentPreservationCli.test.ts +++ b/tests/acceptance/setup/tomlCommentPreservationCli.test.ts @@ -4,6 +4,7 @@ import { parse as parseToml } from "smol-toml"; import { expect } from "vitest"; import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js"; +import { unrelatedValues } from "../../fixtures/unrelatedTomlValues.js"; import { cliTest } from "../../support/cli/cliFixture.js"; const scenarios = [ @@ -60,17 +61,6 @@ const scenarios = [ }, ] as const; -/** Read unrelated values independently of the installed launcher's spelling. */ -const unrelatedValues = (text: string) => { - const document = parseToml(text); - const servers = document.mcp_servers; - if (typeof servers === "object" && servers !== null) { - Reflect.deleteProperty(servers, "rea"); - if (Object.keys(servers).length === 0) delete document.mcp_servers; - } - return document; -}; - cliTest( "TOML setup and uninstall keep comments around middle and final registrations", async ({ cli }) => { diff --git a/tests/boundary/filesystem/clientConfigurationTransactions.test.ts b/tests/boundary/filesystem/clientConfigurationTransactions.test.ts index 8528f90e8ed..83a941e948b 100644 --- a/tests/boundary/filesystem/clientConfigurationTransactions.test.ts +++ b/tests/boundary/filesystem/clientConfigurationTransactions.test.ts @@ -15,6 +15,7 @@ import { dirname, join } from "node:path"; import { describe, expect, it, vi } from "vitest"; import { parse as parseToml } from "smol-toml"; +import { unrelatedValues } from "../../fixtures/unrelatedTomlValues.js"; import { configureClientConfiguration, @@ -453,16 +454,6 @@ const unrelatedServer = [ "", ].join("\n"); -const unrelatedValues = (text: string) => { - const document = parseToml(text); - const servers = document.mcp_servers; - if (typeof servers === "object" && servers !== null) { - Reflect.deleteProperty(servers, "rea"); - if (Object.keys(servers).length === 0) delete document.mcp_servers; - } - return document; -}; - describe("Codex configuration text preservation", () => { it.each([ { diff --git a/tests/fixtures/unrelatedTomlValues.ts b/tests/fixtures/unrelatedTomlValues.ts new file mode 100644 index 00000000000..fda0e1d31ab --- /dev/null +++ b/tests/fixtures/unrelatedTomlValues.ts @@ -0,0 +1,12 @@ +import { parse as parseToml } from "smol-toml"; + +/** Read unrelated values independently of the installed launcher's spelling. */ +export const unrelatedValues = (text: string) => { + const document = parseToml(text); + const servers = document.mcp_servers; + if (typeof servers === "object" && servers !== null) { + Reflect.deleteProperty(servers, "rea"); + if (Object.keys(servers).length === 0) delete document.mcp_servers; + } + return document; +};