Skip to content

Commit

Permalink
test(ssr e2e): redirect also the STDERR stream to the file .ssr.log (
Browse files Browse the repository at this point in the history
…#19271)

Otherwise error logs could be not asserted in the e2e. It will be needed in the future tests of logs content in cases when SSR fails.

BEFORE:
![image](https://github.com/user-attachments/assets/6c3f1136-f0c7-4df5-bb43-7faff2875279)

AFTER:
![image](https://github.com/user-attachments/assets/46fd5a75-dffe-4377-b0b2-2eff99bb47bf)


fixes https://jira.tools.sap/browse/CXSPA-8501
  • Loading branch information
Platonn authored Sep 23, 2024
1 parent bcf9943 commit cebfdf4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/ssr-tests/src/utils/ssr.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export async function startSsrServer({
timeout = DEFAULT_SSR_TIMEOUT,
}: SsrServerOptions = {}) {
child = childProcess.spawn(
`NODE_TLS_REJECT_UNAUTHORIZED=0 SSR_CACHE=${cache} SSR_TIMEOUT=${timeout} PORT=${port} npm run serve:ssr --prefix ../../> .ssr.log`,
// `2>&1` - redirect stderr to stdout, so also `console.error` and `console.warn` messages are captured in the log file
`NODE_TLS_REJECT_UNAUTHORIZED=0 SSR_CACHE=${cache} SSR_TIMEOUT=${timeout} PORT=${port} npm run serve:ssr --prefix ../../> .ssr.log 2>&1`,
{ detached: true, shell: true }
);

Expand Down

0 comments on commit cebfdf4

Please sign in to comment.