Skip to content

Commit 1e9061f

Browse files
committed
Update tests
This bug is now fixed.
1 parent e333303 commit 1e9061f

File tree

4 files changed

+7
-53
lines changed

4 files changed

+7
-53
lines changed

packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,16 +2902,7 @@ describe('ReactFlightDOM', () => {
29022902
abortFizz('bam');
29032903
});
29042904

2905-
if (__DEV__) {
2906-
expect(errors).toEqual([new Error('Connection closed.')]);
2907-
} else {
2908-
// This is likely a bug. In Dev we get a connection closed error
2909-
// because the debug info creates a chunk that has a pending status
2910-
// and when the stream finishes we error if any chunks are still pending.
2911-
// In production there is no debug info so the missing chunk is never instantiated
2912-
// because nothing triggers model evaluation before the stream completes
2913-
expect(errors).toEqual(['bam']);
2914-
}
2905+
expect(errors).toEqual([new Error('Connection closed.')]);
29152906

29162907
const container = document.createElement('div');
29172908
await readInto(container, fizzReadable);
@@ -3066,17 +3057,8 @@ describe('ReactFlightDOM', () => {
30663057
});
30673058

30683059
// one error per boundary
3069-
if (__DEV__) {
3070-
const err = new Error('Connection closed.');
3071-
expect(errors).toEqual([err, err, err]);
3072-
} else {
3073-
// This is likely a bug. In Dev we get a connection closed error
3074-
// because the debug info creates a chunk that has a pending status
3075-
// and when the stream finishes we error if any chunks are still pending.
3076-
// In production there is no debug info so the missing chunk is never instantiated
3077-
// because nothing triggers model evaluation before the stream completes
3078-
expect(errors).toEqual(['boom', 'boom', 'boom']);
3079-
}
3060+
const err = new Error('Connection closed.');
3061+
expect(errors).toEqual([err, err, err]);
30803062

30813063
const container = document.createElement('div');
30823064
await readInto(container, fizzReadable);

packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,17 +2574,7 @@ describe('ReactFlightDOMBrowser', () => {
25742574
root.render(<ClientRoot response={response} />);
25752575
});
25762576

2577-
if (__DEV__) {
2578-
expect(errors).toEqual([new Error('Connection closed.')]);
2579-
expect(container.innerHTML).toBe('');
2580-
} else {
2581-
// This is likely a bug. In Dev we get a connection closed error
2582-
// because the debug info creates a chunk that has a pending status
2583-
// and when the stream finishes we error if any chunks are still pending.
2584-
// In production there is no debug info so the missing chunk is never instantiated
2585-
// because nothing triggers model evaluation before the stream completes
2586-
expect(errors).toEqual([]);
2587-
expect(container.innerHTML).toBe('<div>loading...</div>');
2588-
}
2577+
expect(errors).toEqual([new Error('Connection closed.')]);
2578+
expect(container.innerHTML).toBe('');
25892579
});
25902580
});

packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,16 +1245,7 @@ describe('ReactFlightDOMEdge', () => {
12451245
),
12461246
);
12471247
fizzController.abort('bam');
1248-
if (__DEV__) {
1249-
expect(errors).toEqual([new Error('Connection closed.')]);
1250-
} else {
1251-
// This is likely a bug. In Dev we get a connection closed error
1252-
// because the debug info creates a chunk that has a pending status
1253-
// and when the stream finishes we error if any chunks are still pending.
1254-
// In production there is no debug info so the missing chunk is never instantiated
1255-
// because nothing triggers model evaluation before the stream completes
1256-
expect(errors).toEqual(['bam']);
1257-
}
1248+
expect(errors).toEqual([new Error('Connection closed.')]);
12581249
// Should still match the result when parsed
12591250
const result = await readResult(ssrStream);
12601251
const div = document.createElement('div');

packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMNode-test.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,7 @@ describe('ReactFlightDOMNode', () => {
508508
),
509509
);
510510
ssrStream.abort('bam');
511-
if (__DEV__) {
512-
expect(errors).toEqual([new Error('Connection closed.')]);
513-
} else {
514-
// This is likely a bug. In Dev we get a connection closed error
515-
// because the debug info creates a chunk that has a pending status
516-
// and when the stream finishes we error if any chunks are still pending.
517-
// In production there is no debug info so the missing chunk is never instantiated
518-
// because nothing triggers model evaluation before the stream completes
519-
expect(errors).toEqual(['bam']);
520-
}
511+
expect(errors).toEqual([new Error('Connection closed.')]);
521512
// Should still match the result when parsed
522513
const result = await readResult(ssrStream);
523514
const div = document.createElement('div');

0 commit comments

Comments
 (0)