From 03e17d19e9dd4c2a803ef7215634334aded4e385 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 29 Apr 2026 14:55:25 +0100 Subject: [PATCH] test(plugins): avoid map spread in provider fixture --- src/plugins/providers.test.ts | 41 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/plugins/providers.test.ts b/src/plugins/providers.test.ts index 31d5d4c32cc..9f9db232c48 100644 --- a/src/plugins/providers.test.ts +++ b/src/plugins/providers.test.ts @@ -128,24 +128,29 @@ function setOwningProviderManifestPluginsWithWorkspace() { function createProviderRegistrySnapshotFixture(): PluginRegistrySnapshot { const manifestRegistry = loadPluginManifestRegistryMock(); - const plugins = manifestRegistry.plugins.map((plugin) => ({ - pluginId: plugin.id, - manifestPath: plugin.manifestPath, - manifestHash: `test-${plugin.id}`, - source: plugin.source, - rootDir: plugin.rootDir, - origin: plugin.origin, - enabled: plugin.enabledByDefault !== false, - ...(plugin.enabledByDefault === true ? { enabledByDefault: true } : {}), - syntheticAuthRefs: plugin.syntheticAuthRefs, - startup: { - sidecar: false, - memory: false, - deferConfiguredChannelFullLoadUntilAfterListen: false, - agentHarnesses: [], - }, - compat: [], - })); + const plugins = manifestRegistry.plugins.map((plugin) => { + const snapshotPlugin = { + pluginId: plugin.id, + manifestPath: plugin.manifestPath, + manifestHash: `test-${plugin.id}`, + source: plugin.source, + rootDir: plugin.rootDir, + origin: plugin.origin, + enabled: plugin.enabledByDefault !== false, + syntheticAuthRefs: plugin.syntheticAuthRefs, + startup: { + sidecar: false, + memory: false, + deferConfiguredChannelFullLoadUntilAfterListen: false, + agentHarnesses: [], + }, + compat: [], + }; + if (plugin.enabledByDefault === true) { + Object.assign(snapshotPlugin, { enabledByDefault: true }); + } + return snapshotPlugin; + }); return { version: 1,