


























@@ -58,16 +58,10 @@ describe("applyExclusiveSlotSelection", () => {
5858function expectSelectionWarnings(
5959warnings: string[],
6060params: {
61-contains?: readonly string[];
62-excludes?: readonly string[];
61+expected: readonly string[];
6362},
6463) {
65-if (params.contains?.length) {
66-expect(warnings).toEqual(expect.arrayContaining([...params.contains]));
67-}
68-for (const warning of params.excludes ?? []) {
69-expect(warnings).not.toEqual(expect.arrayContaining([warning]));
70-}
64+expect(warnings).toEqual([...params.expected]);
7165}
72667367function expectUnchangedSelection(result: ReturnType<typeof applyExclusiveSlotSelection>) {
@@ -109,8 +103,7 @@ describe("applyExclusiveSlotSelection", () => {
109103selectedId?: string;
110104expectedDisabled?: boolean;
111105warningChecks: {
112-contains?: readonly string[];
113-excludes?: readonly string[];
106+expected: readonly string[];
114107};
115108}) {
116109const result = runMemorySelection(params.config, params.selectedId);
@@ -134,7 +127,7 @@ describe("applyExclusiveSlotSelection", () => {
134127}),
135128expectedDisabled: false,
136129warningChecks: {
137-contains: [
130+expected: [
138131'Exclusive slot "memory" switched from "memory-core" to "memory".',
139132'Disabled other "memory" slot plugins: memory-core.',
140133],
@@ -144,7 +137,10 @@ describe("applyExclusiveSlotSelection", () => {
144137name: "warns when the slot falls back to a default",
145138config: createMemoryConfig(),
146139warningChecks: {
147-contains: ['Exclusive slot "memory" switched from "memory-core" to "memory".'],
140+expected: [
141+'Exclusive slot "memory" switched from "memory-core" to "memory".',
142+'Disabled other "memory" slot plugins: memory-core.',
143+],
148144},
149145},
150146{
@@ -156,8 +152,7 @@ describe("applyExclusiveSlotSelection", () => {
156152}),
157153expectedDisabled: false,
158154warningChecks: {
159-contains: ['Exclusive slot "memory" switched from "memory-core" to "memory".'],
160-excludes: ['Disabled other "memory" slot plugins: memory-core.'],
155+expected: ['Exclusive slot "memory" switched from "memory-core" to "memory".'],
161156},
162157},
163158] as const)("$name", ({ config, expectedDisabled, warningChecks }) => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。