firefox-devtools / firefox-devtools/profiler

Sometimes the ErrorBoundary test fails locally for me with strange line numbers

Open
#3,734 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
491
Avg merge
3d 5h
Merged PRs (30d)
30

Description

Summary of all failing tests
FAIL src/test/components/ErrorBoundary.test.js
● app/ErrorBoundary › matches the snapshot

expect(received).toMatchSnapshot()

Snapshot name: `app/ErrorBoundary matches the snapshot 1`

- Snapshot - 1
+ Received + 1

@@ -27,11 +27,11 @@


Error: This is an error.



- at ThrowingComponent (REDACTED)/src/test/components/ErrorBoundary.test.js:20:11)
+ at ThrowingComponent (REDACTED)/src/test/components/ErrorBoundary.test.js:30:11)
at ErrorBoundary (REDACTED)/src/components/app/ErrorBoundary.js:28:66)
at LocalizationProvider (REDACTED)/node_modules/@fluent/react/index.js:(REDACTED)




54 | });
55 |
> 56 | it('shows the error message children when the component throws error', () => {
| ^
57 | const { getByText } = setupComponent();
58 | expect(getByText(friendlyErrorMessage)).toBeInTheDocument();
59 | });

at Object. (src/test/components/ErrorBoundary.test.js:56:34)

● app/ErrorBoundary › reports errors to the analytics

expect(jest.fn()).toHaveBeenCalledWith(...expected)

- Expected
+ Received

"send",
"exception",
Object {
- "exDescription": StringMatching /Error: This is an error\.\n\n at ThrowingComponent \(.*[/\\]ErrorBoundary.test.js:20:11\)\n at ErrorBoundary \(.*[/\\]ErrorBoundary.js:28:66\)\n at LocalizationProvider \(.*[/\\]@fluent[/\\]react[/\\]index.js:.*\)/,
+ "exDescription": "Error: This is an error.
+
+ at ThrowingComponent (/Users/mstange/code/perf.html/src/test/components/ErrorBoundary.test.js:30:11)
+ at ErrorBoundary (/Users/mstange/code/perf.html/src/components/app/ErrorBoundary.js:28:66)
+ at LocalizationProvider (/Users/mstange/code/perf.html/node_modules/@fluent/react/index.js:111:26)",
"exFatal": true,
},

Number of calls: 1

87 | new RegExp(stripIndent`
88 | Error: This is an error\\.
> 89 |
| ^
90 | at ThrowingComponent \\(.*[/\\\\]ErrorBoundary.test.js:20:11\\)
91 | at ErrorBoundary \\(.*[/\\\\]ErrorBoundary.js:28:66\\)
92 | at LocalizationProvider \\(.*[/\\\\]@fluent[/\\\\]react[/\\\\]index.js:.*\\)

at callback (src/test/components/ErrorBoundary.test.js:89:23)
at withAnalyticsMock (src/test/fixtures/mocks/analytics.js:13:3)
at Object. (src/test/components/ErrorBoundary.test.js:87:38)

FAIL src/test/components/MenuButtons.test.js
● app/MenuButtons › › matches the snapshot for the opened panel for a nightly profile

expect(received).toMatchSnapshot()

Snapshot name: `app/MenuButtons matches the snapshot for the opened panel for a nightly profile 1`

- Snapshot - 1
+ Received + 1

@@ -84,11 +84,11 @@

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.