Benefits of having big tech companies

Just a thought. Was looking for ways to run unit tests for Electron code. Not e2e ones (e.g. assert window.webContents.getElementByXXX), but only unit tests. But the code is inevitably tangled with Electron API, like ipcRenderer, which will not be available when running using node.

When required from node, require('electron') returns the path to platform-specific binary location.

Test frameworks use runners to run tests - many of them adopted the idea of “plugin framework”. Jest, mocha… they all accepts custom runner, custom testRunner and custom testEnv. Problem is where to find the proper runner (or write one yourself, which may or may not be feasible).

After several non-working solutions (tests never end), finally there’s this:

So that’s the benefit of having bigger tech companies in the industry. Someone would have done work that you don’t have time to, for you.

Written on December 12, 2018