@@ -207,12 +207,13 @@ describe("stageSandboxMedia", () => {
|
207 | 207 | workspaceDir, |
208 | 208 | }); |
209 | 209 | |
210 | | -await expect( |
211 | | -fs.stat(join(sandboxDir, "media", "inbound", basename(sensitiveFile))), |
212 | | -).rejects.toSatisfy((error) => { |
213 | | -expect((error as NodeJS.ErrnoException).code).toBe("ENOENT"); |
214 | | -return true; |
215 | | -}); |
| 210 | +let stagedStatError: NodeJS.ErrnoException | undefined; |
| 211 | +try { |
| 212 | +await fs.stat(join(sandboxDir, "media", "inbound", basename(sensitiveFile))); |
| 213 | +} catch (error) { |
| 214 | +stagedStatError = error as NodeJS.ErrnoException; |
| 215 | +} |
| 216 | +expect(stagedStatError?.code).toBe("ENOENT"); |
216 | 217 | expect(ctx.MediaPath).toBe(sensitiveFile); |
217 | 218 | } |
218 | 219 | |
@@ -289,12 +290,13 @@ describe("stageSandboxMedia", () => {
|
289 | 290 | workspaceDir, |
290 | 291 | }); |
291 | 292 | |
292 | | -await expect( |
293 | | -fs.stat(join(sandboxDir, "media", "inbound", basename(mediaPath))), |
294 | | -).rejects.toSatisfy((error) => { |
295 | | -expect((error as NodeJS.ErrnoException).code).toBe("ENOENT"); |
296 | | -return true; |
297 | | -}); |
| 293 | +let stagedStatError: NodeJS.ErrnoException | undefined; |
| 294 | +try { |
| 295 | +await fs.stat(join(sandboxDir, "media", "inbound", basename(mediaPath))); |
| 296 | +} catch (error) { |
| 297 | +stagedStatError = error as NodeJS.ErrnoException; |
| 298 | +} |
| 299 | +expect(stagedStatError?.code).toBe("ENOENT"); |
298 | 300 | expect(ctx.MediaPath).toBe(mediaPath); |
299 | 301 | expect(sessionCtx.MediaPath).toBe(mediaPath); |
300 | 302 | }); |
|