fix two failing tests
This commit is contained in:
parent
06075c4499
commit
cb78e4875b
2 changed files with 16 additions and 5 deletions
|
@ -102,7 +102,7 @@ class CrashReporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
removeExtraParameter (key) {
|
removeExtraParameter (key) {
|
||||||
binding.setExtraParameter(key)
|
binding.removeExtraParameter(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
setExtraParameter (key, value) {
|
setExtraParameter (key, value) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ const {closeWindow} = require('./window-helpers')
|
||||||
const {remote} = require('electron')
|
const {remote} = require('electron')
|
||||||
const {app, BrowserWindow, crashReporter} = remote.require('electron')
|
const {app, BrowserWindow, crashReporter} = remote.require('electron')
|
||||||
|
|
||||||
describe('crashReporter module', () => {
|
describe.only('crashReporter module', () => {
|
||||||
if (process.mas || process.env.DISABLE_CRASH_REPORTER_TESTS) return
|
if (process.mas || process.env.DISABLE_CRASH_REPORTER_TESTS) return
|
||||||
|
|
||||||
let originalTempDirectory = null
|
let originalTempDirectory = null
|
||||||
|
@ -201,7 +201,11 @@ 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()
|
||||||
assert.equal(name, 'Zombies')
|
if(process.platform === 'win32') {
|
||||||
|
assert.equal(name, 'Zombies')
|
||||||
|
} else {
|
||||||
|
assert.equal(name, 'Electron Test')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -235,15 +239,22 @@ describe('crashReporter module', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// complete
|
// complete
|
||||||
describe('getCrashesDirectory', () => {
|
describe('getCrashesDirectory', () => {
|
||||||
it('correctly returns the directory', () => {
|
it('correctly returns the directory', () => {
|
||||||
const crashesDir = crashReporter.getCrashesDirectory()
|
const crashesDir = crashReporter.getCrashesDirectory()
|
||||||
const dir = `${app.getPath('temp')}Zombies Crashes`
|
let dir
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
dir = `${app.getPath('temp')}/Zombies Crashes`
|
||||||
|
} else {
|
||||||
|
dir = `${app.getPath('temp')}/Electron Test Crashes`
|
||||||
|
}
|
||||||
assert.equal(crashesDir, dir)
|
assert.equal(crashesDir, dir)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// complete
|
||||||
describe('getUploadedReports', () => {
|
describe('getUploadedReports', () => {
|
||||||
it('returns an array of reports', () => {
|
it('returns an array of reports', () => {
|
||||||
const reports = crashReporter.getUploadedReports()
|
const reports = crashReporter.getUploadedReports()
|
||||||
|
@ -251,9 +262,9 @@ describe('crashReporter module', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// complete
|
||||||
describe('getLastCrashReport', () => {
|
describe('getLastCrashReport', () => {
|
||||||
it('correctly returns the most recent report', () => {
|
it('correctly returns the most recent report', () => {
|
||||||
// TODO(codebytere): figure this out
|
|
||||||
const reports = crashReporter.getUploadedReports()
|
const reports = crashReporter.getUploadedReports()
|
||||||
const lastReport = reports[0]
|
const lastReport = reports[0]
|
||||||
assert(lastReport != null)
|
assert(lastReport != null)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue