avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

Run tests with Electron #1451

Closed bokuweb closed 4 years ago

bokuweb commented 7 years ago

Hi. i'm developing Avaron(https://github.com/bokuweb/avaron), which forked from vdbwouter/electron-ava, to run tests with electron .(plase see also, why? (https://github.com/bokuweb/avaron#why )).It works with AVA v0.21+.

Avaron is not forked from AVA, but copy and edit below files from AVA to launch electron.

If I can hook into the below point, I may be able to do Electron support without having to fork/copy from AVA. Is there a good idea?

avaron/lib/cli.js

I needed to add options for electron (renderer, windowOptions and fixture for now).

avaron/lib/fork.js

I needed to modify child_process.spawn to launch electron process.

related

https://github.com/avajs/awesome-ava/pull/21

novemberborn commented 7 years ago

@bokuweb this is really cool!

I'm wondering how we can best support this. I'm not convinced AVA itself should support Electron as a process target. Perhaps though the "test runner pool" could be abstracted so that other pools can be provided by users. In your case that would be an Electron pool. We'd have to determine how to provide CLI flags and package.json options as well. We'd also have to standardize the communication interface between the main AVA process and the test workers.

This is lower-level than #1043 but it could be quite interesting. It may work for Wallaby.js as well.

@avajs/core, @ArtemGovorov, thoughts?

ArtemGovorov commented 7 years ago

@novemberborn I like the idea of the abstracted "test runner pool". It might make it easier for wallaby (as well as others) to integrate with AVA. I think it is generally a good thing to separate the testing framework part from the test runner part, makes it easier to reuse/hook into/integrate with those parts.

sindresorhus commented 7 years ago

Relevant issue: https://github.com/avajs/ava/issues/1428

novemberborn commented 7 years ago

Relevant issue: #1428

Heh I wonder if that was still in by subconscious 👍

novemberborn commented 4 years ago

We're focusing on running just Node.js code for the foreseeable future.