WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto
at e7f57337bebc28bb691369e467b9b4146c07ef92 25 lines 865 B view raw
1import { describe, it, expect } from "vitest"; 2import { isNotFoundError } from "../errors.js"; 3 4describe("isNotFoundError", () => { 5 it("returns true for AppView 404 error", () => { 6 const error = new Error("AppView API error: 404 Not Found"); 7 expect(isNotFoundError(error)).toBe(true); 8 }); 9 10 it("returns false for AppView 500 error", () => { 11 const error = new Error("AppView API error: 500 Internal Server Error"); 12 expect(isNotFoundError(error)).toBe(false); 13 }); 14 15 it("returns false for network error", () => { 16 const error = new Error("AppView network error: fetch failed"); 17 expect(isNotFoundError(error)).toBe(false); 18 }); 19 20 it("returns false for non-Error values", () => { 21 expect(isNotFoundError("not found")).toBe(false); 22 expect(isNotFoundError(null)).toBe(false); 23 expect(isNotFoundError(404)).toBe(false); 24 }); 25});