Skip to content

Commit f7ef168

Browse files
committed
test(doctor): avoid map-spread lint in blocker mock
1 parent 545f251 commit f7ef168

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/commands/doctor/shared/preview-warnings.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ vi.mock("./channel-plugin-blockers.js", () => ({
117117
if (Object.keys(env).some((key) => key.startsWith("DISCORD_"))) {
118118
configuredChannels.add("discord");
119119
}
120-
const hits = manifestState.plugins.flatMap((plugin) => {
120+
const hits: Array<{
121+
channelId: string;
122+
pluginId: string;
123+
reason: string;
124+
channelAvailable?: boolean;
125+
}> = manifestState.plugins.flatMap((plugin) => {
121126
const sourcePlugins = activationSourceConfig.plugins;
122127
const disabledByEntry = sourcePlugins?.entries?.[plugin.id]?.enabled === false;
123128
const pluginsDisabled = sourcePlugins?.enabled === false;
@@ -155,9 +160,12 @@ vi.mock("./channel-plugin-blockers.js", () => ({
155160
plugin.channels.filter((channelId) => configuredChannels.has(channelId)),
156161
),
157162
);
158-
return hits.map((hit) =>
159-
availableChannelIds.has(hit.channelId) ? { ...hit, channelAvailable: true } : hit,
160-
);
163+
for (const hit of hits) {
164+
if (availableChannelIds.has(hit.channelId)) {
165+
hit.channelAvailable = true;
166+
}
167+
}
168+
return hits;
161169
},
162170
collectConfiguredChannelPluginBlockerWarnings: (
163171
hits: Array<{ channelId: string; pluginId: string; reason: string }>,

0 commit comments

Comments
 (0)