()
| 17 | const indexHtml = readFileSync(join(browserDistFolder, 'index.csr.html'), 'utf-8'); |
| 18 | |
| 19 | async function runTest() { |
| 20 | // Test and validate the errors are printed in the console. |
| 21 | const originalConsoleError = console.error; |
| 22 | const errors: string[] = []; |
| 23 | console.error = (error, data) => errors.push(error.toString() + ' ' + data.toString()); |
| 24 | |
| 25 | try { |
| 26 | await renderModule(AppServerModule, { |
| 27 | document: indexHtml, |
| 28 | url: '/error', |
| 29 | }); |
| 30 | } catch {} |
| 31 | |
| 32 | console.error = originalConsoleError; |
| 33 | |
| 34 | // Test case |
| 35 | if (!errors.some((e) => e.includes('Error in resolver'))) { |
| 36 | errors.forEach(console.error); |
| 37 | console.error( |
| 38 | '\nError: expected rendering errors ("Error in resolver") to be printed in the console.\n', |
| 39 | ); |
| 40 | process.exit(1); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | runTest(); |
no test coverage detected
searching dependent graphs…