import assert from "assert"; import dedent from "dedent"; import { ESBUILD, itBundled, testForFile } from "./expectBundled"; var { describe, test, expect } = testForFile(import.meta.path); describe("bundler", () => { itBundled("npm/ReactSSR", { install: ["react@next", "react-dom@next"], files: { "/entry.tsx": /* tsx */ ` import React from "react"; import { renderToReadableStream } from "react-dom/server"; const headers = { headers: { "Content-Type": "text/html", }, }; const App = () => (
This is an example.
); const port = 42001; const server = Bun.serve({ port, async fetch(req) { return new Response(await renderToReadableStream(This is an example.
", }, }); });