()
| 370 | const root = ReactDOMClient.createRoot(container); |
| 371 | |
| 372 | function App() { |
| 373 | console.log('log'); |
| 374 | console.warn('warn'); |
| 375 | console.error('error'); |
| 376 | return <div />; |
| 377 | } |
| 378 | |
| 379 | act(() => |
| 380 | root.render( |
| 381 | <React.StrictMode> |
| 382 | <App /> |
| 383 | </React.StrictMode>, |
| 384 | ), |
| 385 | ); |
| 386 | |
| 387 | expect(global.consoleLogMock).toHaveBeenCalledTimes(2); |
| 388 | expect(global.consoleLogMock.mock.calls[1]).toEqual([ |
| 389 | '\x1b[2;38;2;124;124;124m%s\x1b[0m', |
| 390 | 'log', |
| 391 | ]); |
| 392 | |
| 393 | expect(global.consoleWarnMock).toHaveBeenCalledTimes(2); |
| 394 | expect(global.consoleWarnMock.mock.calls[1]).toEqual([ |
| 395 | '\x1b[2;38;2;124;124;124m%s\x1b[0m', |
| 396 | 'warn', |
| 397 | ]); |
| 398 | |
| 399 | expect(global.consoleErrorMock).toHaveBeenCalledTimes(2); |
| 400 | expect(global.consoleErrorMock.mock.calls[1]).toEqual([ |
| 401 | '\x1b[2;38;2;124;124;124m%s\x1b[0m', |
| 402 | 'error', |
| 403 | ]); |
| 404 | }); |
| 405 | |
| 406 | it('should not double log if hideConsoleLogsInStrictMode is enabled in Strict mode', () => { |
| 407 | global.__REACT_DEVTOOLS_GLOBAL_HOOK__.settings.appendComponentStack = false; |
nothing calls this directly
no test coverage detected