Skip to content

Commit

Permalink
Add fakeConsole.assert
Browse files Browse the repository at this point in the history
Closes #173
  • Loading branch information
inukshuk committed Dec 3, 2020
1 parent 765100e commit b8957e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion renderer/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ const { ipcRenderer: ipc } = require('electron')

const { hasOwnProperty } = Object.prototype

const fakeConsole = {}
const fakeConsole = {
assert (assertion, ...args) {
if (!assertion) fakeConsole.log(...args)
}
}

for (const k in console) {
if (hasOwnProperty.call(console, k) && k !== 'assert') {
fakeConsole[k] = (...args) => ipc.send('console-call', k, args)
Expand Down

0 comments on commit b8957e3

Please sign in to comment.