spec: Make the crash-reporter test more reliable

This commit is contained in:
Cheng Zhao 2015-11-11 10:37:01 +08:00
parent 60ec1ca3f7
commit f63a4a05b7

View file

@ -24,10 +24,15 @@ describe 'crash-reporter module', ->
it 'should send minidump when renderer crashes', (done) ->
@timeout 120000
called = false
server = http.createServer (req, res) ->
server.close()
form = new multiparty.Form()
form.parse req, (error, fields, files) ->
# This callback can be called for twice sometimes.
return if called
called = true
assert.equal fields['prod'], 'Electron'
assert.equal fields['ver'], process.versions['electron']
assert.equal fields['process_type'], 'renderer'