electron-mocha
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -0,1 +1,5 @@ | ||
0.6.2 / 2015-11-21 | ||
------------------ | ||
- report error if in mocha: See: https://github.com/jprichardson/electron-mocha/pull/25 | ||
0.6.1 / 2015-11-05 | ||
@@ -2,0 +6,0 @@ ------------------ |
13
index.js
@@ -10,2 +10,4 @@ var app = require('app') | ||
var mocha = require('./mocha') | ||
var util = require('util') | ||
var path = require('path') | ||
@@ -44,5 +46,16 @@ // these were suppose to do something, but they don't | ||
}) | ||
ipc.on('mocha-error', function(event, data) { | ||
writeError(data) | ||
exit(1) | ||
}) | ||
} | ||
}) | ||
function writeError(data) { | ||
process.stderr.write(util.format('\nError encountered in %s: %s\n%s', | ||
path.relative(process.cwd(), data.filename), | ||
data.message, | ||
data.stack)) | ||
} | ||
function exit (code) { | ||
@@ -49,0 +62,0 @@ fs.remove(browserDataPath, function (err) { |
{ | ||
"name": "electron-mocha", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Mocha tests in Electron.", | ||
@@ -5,0 +5,0 @@ "preferGlobal": true, |
@@ -8,7 +8,10 @@ require('./console') | ||
// consider hooking up to mocha | ||
/* window.onerror = function (message, filename, lineno, colno, err) { | ||
console.log(err.message) | ||
console.log(err.stack) | ||
}*/ | ||
window.onerror = function (message, filename, lineno, colno, err) { | ||
ipc.send('mocha-error', { | ||
message: message, | ||
filename: filename, | ||
err: err, | ||
stack: err.stack | ||
}) | ||
} | ||
@@ -15,0 +18,0 @@ // console.log(JSON.stringify(window.__args__, null, 2)) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14722
221