eventsourcemock
eventsourcemock copied to clipboard
Setup docs
Compared to the current docs, when one creates a React app with the now standard npm create-react-app
, the way to integrate this library will rather be in src/setupTests.js
:
// src/setupTests.js
import EventSource from "eventsourcemock";
Object.defineProperty(window, 'EventSource', {
value: EventSource,
});