Built-in DOM APIs
Bun provides these Web APIs out of the box:fetchRequest,Response,HeadersURL,URLSearchParamsBlob,FileFormDataTextEncoder,TextDecoderReadableStream,WritableStream,TransformStreamWebSocketEventTarget,Event,CustomEventAbortController,AbortSignalstructuredClone
Testing with happy-dom
For full DOM support, usehappy-dom:
#test/setup.ts
bunfig.toml:
Testing React components
Test React components with@testing-library/react:
#test/setup.ts
Testing with jsdom
Alternatively, usejsdom:
#test/setup.ts