()
| 13 | : 'InnerScrollAndFocusHandlerOld' |
| 14 | |
| 15 | function setupLogCapture() { |
| 16 | const logs: string[] = [] |
| 17 | const originalStdout = process.stdout.write |
| 18 | const originalStderr = process.stderr.write |
| 19 | |
| 20 | const capture = (chunk: any) => { |
| 21 | logs.push(stripAnsi(chunk.toString())) |
| 22 | return true |
| 23 | } |
| 24 | |
| 25 | process.stdout.write = function (chunk: any) { |
| 26 | capture(chunk) |
| 27 | return originalStdout.call(this, chunk) |
| 28 | } |
| 29 | |
| 30 | process.stderr.write = function (chunk: any) { |
| 31 | capture(chunk) |
| 32 | return originalStderr.call(this, chunk) |
| 33 | } |
| 34 | |
| 35 | const restore = () => { |
| 36 | process.stdout.write = originalStdout |
| 37 | process.stderr.write = originalStderr |
| 38 | } |
| 39 | |
| 40 | const clearLogs = () => { |
| 41 | logs.length = 0 |
| 42 | } |
| 43 | |
| 44 | return { logs, restore, clearLogs } |
| 45 | } |
| 46 | |
| 47 | describe(`Terminal Logging (${bundlerName})`, () => { |
| 48 | describe('Pages Router', () => { |
no test coverage detected