Ava: Run tests with Electron

Created on 13 Jul 2017  路  5Comments  路  Source: avajs/ava

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.

  • avaron/lib/cli.js (https://github.com/bokuweb/avaron/blob/master/lib/cli.js#L166-L169)
  • avaron/lib/fork.js (https://github.com/bokuweb/avaron/blob/master/lib/fork.js#L59-L66)

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

enhancement low priority question scheduling

Most helpful comment

@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?

All 5 comments

@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?

@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.

Relevant issue: #1428

Heh I wonder if that was still in by subconscious 馃憤

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ivogabe picture ivogabe  路  5Comments

micaelmbagira picture micaelmbagira  路  4Comments

pocesar picture pocesar  路  3Comments

sindresorhus picture sindresorhus  路  5Comments

ehmicky picture ehmicky  路  4Comments