chore: print more logging for failed tests (#22060)

This commit is contained in:
Cheng Zhao 2020-02-07 01:15:55 +09:00 committed by GitHub
parent b664c824d2
commit 629c2121ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -888,8 +888,12 @@ describe('Menu module', function () {
let output = ''
appProcess.stdout.on('data', data => { output += data })
appProcess.stderr.on('data', data => { output += data })
await emittedOnce(appProcess, 'exit')
const [code] = await emittedOnce(appProcess, 'exit')
if (!output.includes('Window has no menu')) {
console.log(code, output)
}
expect(output).to.include('Window has no menu')
})
})

View file

@ -29,8 +29,14 @@ describe('WebContentsView', () => {
it('does not crash on exit', async () => {
const appPath = path.join(__dirname, 'fixtures', 'api', 'leak-exit-webcontentsview.js')
const electronPath = process.execPath
const appProcess = ChildProcess.spawn(electronPath, [appPath])
const appProcess = ChildProcess.spawn(electronPath, ['--enable-logging', appPath])
let output = ''
appProcess.stdout.on('data', data => { output += data })
appProcess.stderr.on('data', data => { output += data })
const [code] = await emittedOnce(appProcess, 'exit')
if (code !== 0) {
console.log(code, output)
}
expect(code).to.equal(0)
})
})