question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to test the renderer with Electron 10?

See original GitHub issue

Hi @jprichardson,

I have been using electron-mocha with great success so far with Electron <= 9. Now I am testing Electron 10 (beta), but electron-mocha fails to test the renderer. When running electron-mocha --renderer "test.js" --no-sandbox on a simple Electron 10 app (with a simple test in the test.js file), there is no output and electron-mocha is stuck. With Electron 9 the renderer tests work normally. Also, the main tests work as expected.

To quickly reconstruct the problem, I forked electron-quick-start and added electron-mocha. You can clone this repo and run the tests yourself:

https://github.com/ffflorian/electron-quick-start

// cc @inukshuk

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
inukshukcommented, Jul 7, 2020

Just noticed that mocha changed some call signatures to be async – so now there are likely race conditions when requiring modules in 9.x. I’ll fix that later today!

1reaction
inukshukcommented, Jul 7, 2020

Thanks for reporting! Just pushed version 9.0.0 which works with Electron 10.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IPC Main <-> Renderer Example Test · Issue #184 - GitHub
I'm running into a an interesting problem with ELectron 12.0.2 , Sinon 10.0.0 and electron-mocha 9.3.3 . I'm converting all IPC calls to...
Read more >
Testing - Electron
To run all unit tests, run npm run test . The unit tests are an Electron app (surprise!) that can be found in...
Read more >
Using Electron 10 with Requirejs in renderer returns an error
I have been using requirejs (latest) with Electron 9, but since Electron 10 when including it in the renderer script I see the...
Read more >
Electron and React integration done right - Patrick Passarella
In this post, I will show you how to create a full React and Electron app, test, and build it. Summary. React app...
Read more >
Notes on running Electron - DataStation
Electron comes with only the most minimal API for communicating between the render process and the main process. In fact it almost doesn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found