





















@@ -256,7 +256,7 @@ describe("bundled plugin postinstall", () => {
256256await fs.writeFile(path.join(extensionsDir, "acpx", "package.json"), "{}\n");
257257const warn = vi.fn();
258258259-expect(() =>
259+expect(
260260runBundledPluginPostinstall({
261261env: { HOME: "/tmp/home" },
262262 packageRoot,
@@ -265,7 +265,7 @@ describe("bundled plugin postinstall", () => {
265265}),
266266log: { log: vi.fn(), warn },
267267}),
268-).not.toThrow();
268+).toBeUndefined();
269269270270expect(warn).toHaveBeenCalledWith(
271271"[postinstall] could not prune bundled plugin source node_modules: Error: locked",
@@ -566,7 +566,7 @@ describe("bundled plugin postinstall", () => {
566566it("keeps legacy plugin runtime deps cleanup non-fatal", () => {
567567const warn = vi.fn();
568568569-expect(() =>
569+expect(
570570pruneLegacyPluginRuntimeDepsState({
571571env: { HOME: "/home/alice" },
572572existsSync: vi.fn(() => true),
@@ -576,7 +576,7 @@ describe("bundled plugin postinstall", () => {
576576log: { log: vi.fn(), warn },
577577homedir: () => "/home/alice",
578578}),
579-).not.toThrow();
579+).toEqual([]);
580580581581expect(warn).toHaveBeenCalledWith(
582582expect.stringContaining(
@@ -645,13 +645,13 @@ describe("bundled plugin postinstall", () => {
645645return readFileSyncOriginal(filePath, options);
646646});
647647648-expect(() =>
648+expect(
649649pruneInstalledPackageDist({
650650 packageRoot,
651651 readFileSync,
652652log: { log: vi.fn(), warn: vi.fn() },
653653}),
654-).not.toThrow();
654+).toEqual(["dist/stale.js"]);
655655656656await expect(fs.stat(staleFile)).rejects.toMatchObject({ code: "ENOENT" });
657657});
@@ -701,12 +701,12 @@ describe("bundled plugin postinstall", () => {
701701await fs.writeFile(staleFile, "export {};\n");
702702const warn = vi.fn();
703703704-expect(() =>
704+expect(
705705runBundledPluginPostinstall({
706706 packageRoot,
707707log: { log: vi.fn(), warn },
708708}),
709-).not.toThrow();
709+).toBeUndefined();
710710711711await expectPathExists(staleFile);
712712expect(warn).toHaveBeenCalledWith(
@@ -723,12 +723,12 @@ describe("bundled plugin postinstall", () => {
723723await fs.writeFile(inventoryPath, "{not-json}\n");
724724const warn = vi.fn();
725725726-expect(() =>
726+expect(
727727runBundledPluginPostinstall({
728728 packageRoot,
729729log: { log: vi.fn(), warn },
730730}),
731-).not.toThrow();
731+).toBeUndefined();
732732733733await expectPathExists(currentFile);
734734expect(warn).toHaveBeenCalledWith(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。