From 10bb7a564d0532a1976de3745a832283dd11eb3e Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Sun, 23 Aug 2020 01:11:18 -0700 Subject: [PATCH] WIP try to improve error output. See https://github.com/lume/cli/issues/11 --- config/karma-helpful-error-output.js | 16 ++++++++++++++++ config/karma.config.js | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 config/karma-helpful-error-output.js diff --git a/config/karma-helpful-error-output.js b/config/karma-helpful-error-output.js new file mode 100644 index 0000000..6e76d20 --- /dev/null +++ b/config/karma-helpful-error-output.js @@ -0,0 +1,16 @@ +// const {remote} = require('electron') + +window.addEventListener('error', err => { + console.log(err) + // remote.getGlobal('console').log(err) +}) + +// process.on('uncaughtException', err => { +// console.log(err) +// remote.getGlobal('global').console.log(err) +// }) + +// remote.getGlobal('global').process.on('uncaughtException', err => { +// console.log(err) +// remote.getGlobal('global').console.log(err) +// }) diff --git a/config/karma.config.js b/config/karma.config.js index 608c07b..73f9524 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -145,6 +145,8 @@ module.exports = function(config) { // https://github.com/twolfson/karma-electron/issues/44. path.resolve(__dirname, 'karma-augment-node-path.js'), + path.resolve(__dirname, 'karma-helpful-error-output.js'), + // Include all the test files *after* augment-node-path.js. {pattern: 'dist/**/*.test.js', watched: false}, ],