twolfson / karma-electron

Karma launcher and preprocessor for Electron
The Unlicense
59 stars 21 forks source link

[Feature Request]: Ability to require additional files inside main process #24

Closed colinskow closed 7 years ago

colinskow commented 7 years ago

I am unit testing IPC interactions between the renderer and main process, and need the ability to inject code into the main process. Ideally I would like a configuration option which will pass a file to be required inside electron-launcher.js.

twolfson commented 7 years ago

We are open to supporting this, in fact there's #23 which adds this functionality but it's still being iterated on

amireh commented 7 years ago

I'm gonna see if I can get #23 into shape tomorrow, I have some free time then.

Personally, I can live without the other features the PR brings, or maybe I can keep using my fork and get only this piece upstream.

colinskow commented 7 years ago

electron-mocha has this functionality through a command line option. It works very well, but most of my unit tests are designed for Karma so it would be excellent to do this with karma-electron.

twolfson commented 7 years ago

This hasn't been released yet but will be shortly after a few tweaks to the now landed PR

twolfson commented 7 years ago

require support has been landed/released in 5.2.0 via @amireh's work in #23