UNPKG

next

Version:

The React Framework

20 lines (19 loc) 1.08 kB
/** * The lifecycle events Cache Components validation emits so E2E tests can * locate the validation window in the CLI output. Each is serialized between * `<VALIDATION_MESSAGE>` delimiters (see `formatValidationEvent`) and parsed * back by the test harness. Produced by the in-process validation in * `app-render.tsx` (both dev and build) and by the validation worker, which is * why the shape lives here rather than in a single producer. * * `requestId` correlates a start with its matching end/aborted. Dev and worker * validation use the render's request id; build validation, which has no such * id, uses a stringified timestamp instead. */ /** * Wraps a validation event in the `<VALIDATION_MESSAGE>` delimiters the test * harness scans for. The caller chooses the output stream (dev validation logs * to stdout; build validation uses stderr for deterministic ordering). */ export function formatValidationEvent(event) { return '<VALIDATION_MESSAGE>' + JSON.stringify(event) + '</VALIDATION_MESSAGE>'; } //# sourceMappingURL=dev-validation-events.js.map