|
@@ -6,9 +6,13 @@ const originalConsoleError = console.error;
|
|
|
// List of `console.error` messages to ignore
|
|
|
// (i.e. don't fail tests when we get these messages)
|
|
|
const IGNORED_ERRORS = [
|
|
|
- (message, ...args) => message?.includes('Warning: ') && args[0] === 'CreatableSelect',
|
|
|
+ (message, ...args) =>
|
|
|
+ typeof message === 'string' &&
|
|
|
+ message.includes('Warning: ') &&
|
|
|
+ args[0] === 'CreatableSelect',
|
|
|
message =>
|
|
|
- message?.includes(
|
|
|
+ typeof message === 'string' &&
|
|
|
+ message.includes(
|
|
|
'The pseudo class ":first-child" is potentially unsafe when doing server-side rendering.'
|
|
|
),
|
|
|
];
|
|
@@ -32,6 +36,7 @@ jest.spyOn(console, 'error').mockImplementation((message, ...args) => {
|
|
|
err.stack = ['\n', lines?.[0], ...lines?.slice(startIndex)].join('\n');
|
|
|
|
|
|
// `fail` is a global from jest/jasmine
|
|
|
+ // eslint-disable-next-line jest/no-jasmine-globals
|
|
|
fail(err);
|
|
|
}
|
|
|
});
|