fix: guard EventSource for jsdom test env, add rate-limits MSW handler
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user