From 7d84dca254b52d15e77a11faa758a2b14a59f6a7 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 25 Mar 2022 07:27:15 -0700 Subject: Update response.file.test.js --- integration/bunjs-only-snippets/response.file.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'integration/bunjs-only-snippets/response.file.test.js') diff --git a/integration/bunjs-only-snippets/response.file.test.js b/integration/bunjs-only-snippets/response.file.test.js index 6e1191433..d094c0a62 100644 --- a/integration/bunjs-only-snippets/response.file.test.js +++ b/integration/bunjs-only-snippets/response.file.test.js @@ -2,6 +2,14 @@ import fs from "fs"; import { it, expect } from "bun:test"; import path from "path"; +it("Bun.file not found returns ENOENT", async () => { + try { + await Bun.file("/does/not/exist.txt").text(); + } catch (exception) { + expect(exception.code).toBe("ENOENT"); + } +}); + it("Bun.write('out.txt', 'string')", async () => { for (let erase of [true, false]) { if (erase) { -- cgit v1.2.3