mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
Nothing exercised the dev CSS path: CI's e2e run serves a production build, and vitest.config.ts never loads vite.config.js, so dropping `css.transformer` would leave every check green while Safari below 18.4 lost its blur again. Drives the real config through Vite's programmatic server and asserts both the standard and prefixed properties. Removing the transformer fails it. Also trims the comment above the setting to the two lines the repo allows. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BEtFQ17BQDS52wXosTjcUU
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import path from "node:path";
|
|
import { createServer, type ViteDevServer } from "vite";
|
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
|
|
// The dev server is the only place this is observable: CI's e2e run serves a
|
|
// production build, and vitest.config.ts never loads vite.config.js, so a
|
|
// dropped `css.transformer` would leave every other check green.
|
|
describe("dev server CSS", () => {
|
|
let server: ViteDevServer;
|
|
|
|
beforeAll(async () => {
|
|
server = await createServer({
|
|
configFile: path.resolve(process.cwd(), "vite.config.js"),
|
|
server: { middlewareMode: true },
|
|
logLevel: "error",
|
|
});
|
|
}, 60_000);
|
|
|
|
afterAll(async () => {
|
|
await server?.close();
|
|
});
|
|
|
|
it("generates vendor prefixes, not only on the build's minify path", async () => {
|
|
const result = await server.transformRequest(
|
|
"/test/fixtures/prefix-probe.css",
|
|
);
|
|
expect(result?.code).toMatch(/-webkit-backdrop-filter:\s*blur\(1px\)/);
|
|
expect(result?.code).toMatch(/[^-]backdrop-filter:\s*blur\(1px\)/);
|
|
});
|
|
});
|