@@ -97,13 +97,15 @@ describe("resolveTsdownBuildInvocation", () => {
|
97 | 97 | await expect( |
98 | 98 | fsPromises.readFile(path.join(distRuntimeDir, "heartbeat-runner.runtime.js"), "utf8"), |
99 | 99 | ).resolves.toBe("alias\n"); |
100 | | -await expect(fsPromises.stat(path.join(distDir, "delegate-BPjCe4gC.js"))).rejects.toThrow(); |
| 100 | +await expect(fsPromises.stat(path.join(distDir, "delegate-BPjCe4gC.js"))).rejects.toMatchObject( |
| 101 | +{ code: "ENOENT" }, |
| 102 | +); |
101 | 103 | await expect( |
102 | 104 | fsPromises.stat(path.join(distDir, "compact.runtime-2DiEmVcA.js")), |
103 | | -).rejects.toThrow(); |
| 105 | +).rejects.toMatchObject({ code: "ENOENT" }); |
104 | 106 | await expect( |
105 | 107 | fsPromises.stat(path.join(distRuntimeDir, "heartbeat-runner.runtime-fspOEj_1.js")), |
106 | | -).rejects.toThrow(); |
| 108 | +).rejects.toMatchObject({ code: "ENOENT" }); |
107 | 109 | }); |
108 | 110 | |
109 | 111 | it("cleans tsdown output roots before using tsdown --no-clean", async () => { |
@@ -123,9 +125,11 @@ describe("resolveTsdownBuildInvocation", () => {
|
123 | 125 | |
124 | 126 | cleanTsdownOutputRoots({ cwd: rootDir }); |
125 | 127 | |
126 | | -await expect(fsPromises.stat(distFile)).rejects.toThrow(); |
127 | | -await expect(fsPromises.stat(pluginGeneratedFile)).rejects.toThrow(); |
128 | | -await expect(fsPromises.stat(path.join(rootDir, "dist-runtime"))).rejects.toThrow(); |
| 128 | +await expect(fsPromises.stat(distFile)).rejects.toMatchObject({ code: "ENOENT" }); |
| 129 | +await expect(fsPromises.stat(pluginGeneratedFile)).rejects.toMatchObject({ code: "ENOENT" }); |
| 130 | +await expect(fsPromises.stat(path.join(rootDir, "dist-runtime"))).rejects.toMatchObject({ |
| 131 | +code: "ENOENT", |
| 132 | +}); |
129 | 133 | await expect(fsPromises.readFile(unrelatedFile, "utf8")).resolves.toBe("keep\n"); |
130 | 134 | }); |
131 | 135 | }); |
|