28 lines · 1.0 KB · TypeScript
RawDownload
import { describe, expect, it } from "vite-plus/test"; import { isProjectFaviconFallbackUrl, PROJECT_FAVICON_FALLBACK_MARKER } from "./projectFavicon.ts"; describe("project favicon", () => {  it("identifies fallback asset URLs by their dedicated filename", () => {    expect(      isProjectFaviconFallbackUrl(        `https://environment.example/api/assets/signed-token/${PROJECT_FAVICON_FALLBACK_MARKER}`,      ),    ).toBe(true);    expect(      isProjectFaviconFallbackUrl(`/api/assets/signed-token/${PROJECT_FAVICON_FALLBACK_MARKER}`),    ).toBe(true);  });   it("does not mistake real favicons or query parameters for fallbacks", () => {    expect(      isProjectFaviconFallbackUrl("https://environment.example/api/assets/token/favicon.svg"),    ).toBe(false);    expect(      isProjectFaviconFallbackUrl(        `https://environment.example/api/assets/token/favicon.svg?name=${PROJECT_FAVICON_FALLBACK_MARKER}`,      ),    ).toBe(false);    expect(isProjectFaviconFallbackUrl(null)).toBe(false);  });});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t