Skip to content

Commit

Permalink
Fix production tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Sep 28, 2022
1 parent 7cbcf7e commit 3faa3ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 8 additions & 3 deletions packages/react-dom/src/__tests__/InvalidEventListeners-test.js
Expand Up @@ -65,9 +65,14 @@ describe('InvalidEventListeners', () => {

if (!__DEV__) {
expect(console.error).toHaveBeenCalledTimes(1);
expect(console.error.calls.argsFor(0)[0]).toMatch(
'Expected `onClick` listener to be a function, ' +
'instead got a value of `string` type.',
expect(console.error.calls.argsFor(0)[0]).toEqual(
expect.objectContaining({
detail: expect.objectContaining({
message:
'Expected `onClick` listener to be a function, instead got a value of `string` type.',
}),
type: 'unhandled exception',
}),
);
}
});
Expand Down
Expand Up @@ -124,9 +124,9 @@ describe('ReactDOMConsoleErrorReporting', () => {
expect(console.error.calls.all().map(c => c.args)).toEqual([
[
// Reported because we're in a browser click event:
expect.stringContaining('Error: Uncaught [Error: Boom]'),
expect.objectContaining({
message: 'Boom',
detail: expect.objectContaining({message: 'Boom'}),
type: 'unhandled exception',
}),
],
]);
Expand Down Expand Up @@ -657,9 +657,9 @@ describe('ReactDOMConsoleErrorReporting', () => {
expect(console.error.calls.all().map(c => c.args)).toEqual([
[
// Reported because we're in a browser click event:
expect.stringContaining('Error: Uncaught [Error: Boom]'),
expect.objectContaining({
message: 'Boom',
detail: expect.objectContaining({message: 'Boom'}),
type: 'unhandled exception',
}),
],
]);
Expand Down

0 comments on commit 3faa3ee

Please sign in to comment.