fetchをモックするとかでHTMLを含んだResponseを作るのにReactDOMServerのrenderToStaticMarkupが使える
WHATWG Fetchの fetch (じゃなくてもいいけど)をモックするとき Response オブジェクトを作る必要がある 第1引数に渡す bodyInit は <html><head><title>Hoge</title></head></html> とかHTMLを文字列で書いてもいい code:tsx
new Response(
renderToStaticMarkup(
<html>
<head>
<title>Example</title>
</head>
</html>,
),
{ headers: { "Content-Type": "text/html" } },
)