MCPcopy
hub / github.com/angular/angular / runTest

Function runTest

integration/platform-server/projects/standalone/prerender.ts:19–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17const indexHtml = readFileSync(join(browserDistFolder, 'index.csr.html'), 'utf-8');
18
19async 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 renderApplication(bootstrap, {
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
44runTest();

Callers 1

prerender.tsFile · 0.70

Calls 7

renderApplicationFunction · 0.90
someMethod · 0.80
toStringMethod · 0.65
errorMethod · 0.65
pushMethod · 0.45
forEachMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…