Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser Mode: Electron support #5883

Open
4 tasks done
rynoV opened this issue Jun 13, 2024 · 0 comments
Open
4 tasks done

Browser Mode: Electron support #5883

rynoV opened this issue Jun 13, 2024 · 0 comments
Labels
feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@rynoV
Copy link

rynoV commented Jun 13, 2024

Clear and concise description of the problem

It would be great to have an Electron mode for browser mode so that Electron apps could be tested easily. Currently, to test code that needs to import electron (provided by the electron runtime here, I believe), my understanding is it's necessary to either mock electron or set up full E2E testing manually, outside of vitest.

I may be able to make a PR for this, with some guidance.

Suggested solution

Webdriverio and Playwright seem to have some kind of Electron support:

However I'm not sure if those play nicely with the model of browser mode.

Alternative

An alternative which would be very useful: to just allow testing the main Electron process code (not testing the renderer or preload code). It may be as easy as allowing to swap node:vm for the electron executable here in the vite-node runtime, since my understanding is the electron exec is just a wrapper around node with electron modules injected. It seems like there has been a lot of work put into vite-node, so it would be nice to reuse that instead of making an entirely new runner.

Additional context

Electron was mentioned in #1470 in the context of custom test runners, but I'm not sure if any work specific to electron was done.

This repo could be useful for making a new runner or modifying the existing: https://github.com/kayahr/jest-electron-runner

Validations

@sheremet-va sheremet-va added feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority) and removed enhancement: pending triage labels Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

2 participants