fix: guard EventSource for jsdom test env, add rate-limits MSW handler

This commit is contained in:
Celes Renata
2026-04-16 08:19:53 +00:00
parent 58a05ca322
commit c5e9644f6f
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -24,6 +24,9 @@ function usePipelineStream() {
const [data, setData] = useState<StreamData | null>(null);
useEffect(() => {
// EventSource is not available in test environments (jsdom)
if (typeof EventSource === 'undefined') return;
const base = import.meta.env.VITE_QUERY_API_BASE || '';
const url = `${base}/api/ops/pipeline/stream`;
const es = new EventSource(url);