Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/components/ErrorBoundary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ describe("ErrorBoundary", () => {
expect(container.textContent).toBe("Content");
});

it("should catch errors thrown again after reset", () => {
shouldThrow = true;
render({ resetKeys: [1] });
expect(container.textContent).toBe("Error");

render({ resetKeys: [2] });
expect(container.textContent).toBe("Error");
});

it("should render a null fallback if specified", () => {
shouldThrow = true;
act(() => {
Expand Down Expand Up @@ -359,6 +368,5 @@ describe("ErrorBoundary", () => {
});

// TODO Various cases with resetKeys changing (length, order, etc)
// TODO Errors thrown again after reset are caught
// TODO Nested error boundaries if a fallback throws
});
Loading