

























@@ -123,6 +123,10 @@ function resolvePath(tmp: string, relativePath: string) {
123123return path.join(tmp, relativePath);
124124}
125125126+async function expectPathMissing(targetPath: string): Promise<void> {
127+await expect(fs.access(targetPath)).rejects.toMatchObject({ code: "ENOENT" });
128+}
129+126130async function writeProjectFiles(tmp: string, files: Record<string, string>) {
127131for (const [relativePath, contents] of Object.entries(files)) {
128132const absolutePath = resolvePath(tmp, relativePath);
@@ -1593,8 +1597,8 @@ describe("run-node script", () => {
1593159715941598expect(exitCode).toBe(0);
15951599expect(spawnCalls).toEqual([statusCommandSpawn()]);
1596-await expect(fs.access(resolvePath(tmp, DIST_EXTENSION_MANIFEST))).rejects.toThrow();
1597-await expect(fs.access(resolvePath(tmp, DIST_EXTENSION_PACKAGE))).rejects.toThrow();
1600+await expectPathMissing(resolvePath(tmp, DIST_EXTENSION_MANIFEST));
1601+await expectPathMissing(resolvePath(tmp, DIST_EXTENSION_PACKAGE));
15981602});
15991603});
16001604此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。