From 7e22523ed2b8bd2f25efed5ab9b631d9877fe351 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 9 Mar 2021 01:23:55 +0900 Subject: [PATCH] test: print more infomation in locale test (#28040) --- spec-main/chromium-spec.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec-main/chromium-spec.ts b/spec-main/chromium-spec.ts index f8a28f600a9a..844996c2b756 100644 --- a/spec-main/chromium-spec.ts +++ b/spec-main/chromium-spec.ts @@ -318,8 +318,14 @@ describe('command line switches', () => { let output = ''; appProcess.stdout.on('data', (data) => { output += data; }); + let stderr = ''; + appProcess.stderr.on('data', (data) => { stderr += data; }); + + const [code, signal] = await emittedOnce(appProcess, 'exit'); + if (code !== 0) { + throw new Error(`Process exited with code "${code}" signal "${signal}" output "${output}" stderr "${stderr}"`); + } - await emittedOnce(appProcess.stdout, 'end'); output = output.replace(/(\r\n|\n|\r)/gm, ''); expect(output).to.equal(result); };