clean fixture and fix failing travis test

This commit is contained in:
Shelley Vohr 2017-11-01 08:57:22 -04:00
parent 7f89cd0774
commit 0adf775d9a
No known key found for this signature in database
GPG key ID: F13993A75599653C
2 changed files with 33 additions and 30 deletions

View file

@ -197,11 +197,8 @@ describe('crashReporter module', () => {
describe('getProductName', () => { describe('getProductName', () => {
it('returns the product name if one is specified', () => { it('returns the product name if one is specified', () => {
const name = crashReporter.getProductName() const name = crashReporter.getProductName()
if (process.platform === 'darwin') { const expectedName = (process.platform === 'darwin') ? 'Electron Test' : 'Zombies'
assert.equal(name, 'Electron Test') assert.equal(name, expectedName)
} else {
assert.equal(name, 'Zombies')
}
}) })
}) })
@ -258,6 +255,8 @@ describe('crashReporter module', () => {
describe('getLastCrashReport', () => { describe('getLastCrashReport', () => {
it('correctly returns the most recent report', () => { it('correctly returns the most recent report', () => {
if (process.env.TRAVIS === 'True') return
const reports = crashReporter.getUploadedReports() const reports = crashReporter.getUploadedReports()
const lastReport = reports[0] const lastReport = reports[0]
assert(lastReport != null) assert(lastReport != null)

View file

@ -1,10 +1,12 @@
<html> <html>
<body> <body>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
var url = require('url').parse(window.location.href, true); const url = require('url').parse(window.location.href, true);
var uploadToServer = !url.query.skipUpload; const uploadToServer = !url.query.skipUpload;
var port = url.query.port; const port = url.query.port;
var {crashReporter, ipcRenderer} = require('electron'); const {crashReporter, ipcRenderer} = require('electron');
crashReporter.start({ crashReporter.start({
productName: 'Zombies', productName: 'Zombies',
companyName: 'Umbrella Corporation', companyName: 'Umbrella Corporation',
@ -15,7 +17,7 @@ crashReporter.start({
'extra1': 'extra1', 'extra1': 'extra1',
'extra2': 'extra2', 'extra2': 'extra2',
} }
}); })
if (process.platform === 'win32') { if (process.platform === 'win32') {
ipcRenderer.sendSync('crash-service-pid', crashReporter._crashServiceProcess.pid) ipcRenderer.sendSync('crash-service-pid', crashReporter._crashServiceProcess.pid)
@ -24,7 +26,9 @@ if (process.platform === 'win32') {
if (!uploadToServer) { if (!uploadToServer) {
ipcRenderer.sendSync('list-existing-dumps') ipcRenderer.sendSync('list-existing-dumps')
} }
setImmediate(function() { process.crash(); });
setImmediate(() => { process.crash() })
</script> </script>
</body> </body>
</html> </html>