Skip to content

Commit

Permalink
Add a previously failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Mar 18, 2021
1 parent 7d1675c commit 3036225
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/react-dom/src/__tests__/ReactDOMFizzServerNode-test.js
Expand Up @@ -68,6 +68,24 @@ describe('ReactDOMFizzServer', () => {
expect(output.result).toBe('<div>hello world</div>');
});

// @gate experimental
it('should start writing after startWriting', () => {
const {writable, output} = getTestWritable();
const {startWriting} = ReactDOMFizzServer.pipeToNodeWritable(
<div>hello world</div>,
writable,
);
jest.runAllTimers();
// First we write our header.
output.result +=
'<!doctype html><html><head><title>test</title><head><body>';
// Then React starts writing.
startWriting();
expect(output.result).toBe(
'<!doctype html><html><head><title>test</title><head><body><div>hello world</div>',
);
});

// @gate experimental
it('should error the stream when an error is thrown at the root', async () => {
const {writable, output, completed} = getTestWritable();
Expand Down

0 comments on commit 3036225

Please sign in to comment.