// @vitest-environment jsdom // // The React transform must not eat the space between a word and the element or expression that // follows it on the same line. It did, in dev and in this test lane (never in the production build): // @vitejs/plugin-react only recognises the React Compiler by its package NAME, and reactPlugin.ts // passes the imported plugin, so the React plugin kept Babel's `retainLines` on. The compiler then // printed "for example " and the next element on different lines, and the JSX transform trimmed the // line-end space ("for example/api/feed" on the privacy page). reactPlugin.ts now turns // `retainLines` off itself. The component goes through the same transform the app does. import { describe, it, expect, afterEach } from "vitest"; import { render, cleanup } from "@testing-library/react"; afterEach(cleanup); function Sentence({ value }: { value: string }) { // The line breaks ARE the test: collapsed onto one line, the defect doesn't fire. // prettier-ignore return (
which part of the app was called (for example /api/feed, never the search
status: {value} end