Use electabul to instrument and report coverage
This commit is contained in:
parent
2c0de93f06
commit
ad07a20d9a
6 changed files with 30 additions and 183 deletions
|
@ -8,6 +8,7 @@ const dialog = electron.dialog
|
|||
const BrowserWindow = electron.BrowserWindow
|
||||
const protocol = electron.protocol
|
||||
|
||||
const Coverage = require('electabul').Coverage
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const url = require('url')
|
||||
|
@ -63,8 +64,13 @@ ipcMain.on('echo', function (event, msg) {
|
|||
event.returnValue = msg
|
||||
})
|
||||
|
||||
ipcMain.on('get-coverage', function(event) {
|
||||
event.returnValue = global.__coverage__
|
||||
const coverage = new Coverage({
|
||||
outputPath: path.join(__dirname, '..', '..', 'out', 'coverage')
|
||||
})
|
||||
coverage.setup()
|
||||
|
||||
ipcMain.on('get-main-process-coverage', function (event) {
|
||||
event.returnValue = global.__coverage__ || null
|
||||
})
|
||||
|
||||
global.isCi = !!argv.ci
|
||||
|
@ -84,8 +90,6 @@ app.on('window-all-closed', function () {
|
|||
app.quit()
|
||||
})
|
||||
|
||||
require('../coverage/reporter').setupCoverage()
|
||||
|
||||
app.on('ready', function () {
|
||||
// Test if using protocol module would crash.
|
||||
electron.protocol.registerStringProtocol('test-if-crashes', function () {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue