spec: Use random port when creating http server.
This commit is contained in:
Родитель
d3cda97d50
Коммит
0b3b621f81
|
@ -1,6 +1,7 @@
|
|||
assert = require 'assert'
|
||||
path = require 'path'
|
||||
http = require 'http'
|
||||
url = require 'url'
|
||||
remote = require 'remote'
|
||||
formidable = require 'formidable'
|
||||
|
||||
|
@ -31,5 +32,10 @@ describe 'crash-reporter module', ->
|
|||
res.end()
|
||||
server.close()
|
||||
done()
|
||||
server.listen 1127, '127.0.0.1', ->
|
||||
w.loadUrl 'file://' + path.join(fixtures, 'api', 'crash.html')
|
||||
port = Math.floor(Math.random() * 55535 + 10000)
|
||||
server.listen port, '127.0.0.1', ->
|
||||
url = url.format
|
||||
protocol: 'file'
|
||||
pathname: path.join fixtures, 'api', 'crash.html'
|
||||
search: "?port=#{port}"
|
||||
w.loadUrl url
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
var port = require('url').parse(window.location.href, true).query.port;
|
||||
var crashReporter = require('crash-reporter');
|
||||
crashReporter.start({
|
||||
productName: 'Zombies',
|
||||
companyName: 'Umbrella Corporation',
|
||||
submitUrl: 'http://127.0.0.1:1127',
|
||||
submitUrl: 'http://127.0.0.1:' + port,
|
||||
autoSubmit: true,
|
||||
ignoreSystemCrashHandler: true,
|
||||
extra: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче