70bf21e064
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
32 lines
1.3 KiB
TypeScript
32 lines
1.3 KiB
TypeScript
import { test } from "vitest";
|
|
import { getResponse, getTextResponse } from "../../__test-utils__";
|
|
|
|
test("fetches public directory asset", async ({ expect }) => {
|
|
const response = await getResponse("/public-directory-asset");
|
|
const contentType = await response.headerValue("content-type");
|
|
const additionalHeader = await response.headerValue("additional-header");
|
|
expect(contentType).toBe("image/svg+xml");
|
|
expect(additionalHeader).toBe("public-directory-asset");
|
|
});
|
|
|
|
test("fetches imported asset", async ({ expect }) => {
|
|
const response = await getResponse("/imported-asset");
|
|
const contentType = await response.headerValue("content-type");
|
|
const additionalHeader = await response.headerValue("additional-header");
|
|
expect(contentType).toBe("image/svg+xml");
|
|
expect(additionalHeader).toBe("imported-asset");
|
|
});
|
|
|
|
test("fetches imported asset with url suffix", async ({ expect }) => {
|
|
const text = await getTextResponse("/imported-asset-url-suffix");
|
|
expect(text).toBe(`The text content is "Text content"`);
|
|
});
|
|
|
|
test("fetches inline asset", async ({ expect }) => {
|
|
const response = await getResponse("/inline-asset");
|
|
const contentType = await response.headerValue("content-type");
|
|
const additionalHeader = await response.headerValue("additional-header");
|
|
expect(contentType).toBe("image/svg+xml");
|
|
expect(additionalHeader).toBe("inline-asset");
|
|
});
|