npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

electron-ava

v0.3.0

Published

Electron testing in AVA

Readme

Electron-AVA

CircleCI

All the simpleness of AVA tests for Electron.

Usage

If you are already using ava, you can just replace ava with electron-ava in your package.json (assuming all your tests run in the main process. If not, see renderer tests).

Otherwise, you can install electron-ava with the following command:

$ npm install electron-ava --save-dev

Or, if you prefer yarn:

$ yarn add electron-ava -D

Then add the following in your package.json:

"scripts": {
	"test": "electron-ava"
}

It should now look a bit like this:

{
	"scripts": {
		"test": "electron-ava"
	},
	"devDependencies": {
		"electron-ava": "^0.1.0"
	}
}

That's all! You can now run your Electron tests in AVA using yarn test or npm test.

Command line interface

  Usage
    electron-ava [<file|directory|glob> ...]

  Options
    --fail-fast             Stop after first test failure
    --serial, -s            Run tests serially
    --tap, -t               Generate TAP output
    --verbose, -v           Enable verbose output
    --no-cache              Disable the transpiler cache
    --no-power-assert       Disable Power Assert
    --match, -m             Only run tests with matching title (Can be repeated)
    --watch, -w             Re-run tests when tests and source files change
    --source, -S            Pattern to match source files so tests can be re-run (Can be repeated)
    --timeout, -T           Set global timeout
    --concurrency, -c       Maximum number of test files running at the same time (EXPERIMENTAL)
    --update-snapshots, -u  Update snapshots
    --renderer              Run the tests in the renderer process

  Examples
    electron-ava
    electron-ava test.js test2.js
    electron-ava test-*.js
    electron-ava test

  Default patterns when no arguments:
  test.js test-*.js test/**/*.js **/__tests__/**/*.js **/*.test.js

The CLI has the same options as the AVA CLI, except for the options --init and --renderer. --init has not yet been added and --renderer has been added.

--renderer allows you to run the tests in the renderer process instead of the main process.

Renderer process tests

If you want to run your tests in the renderer process, you can add the renderer option to the electron-ava section in your package.json and give it the value true. This config works the same as the ava config.

Your package.json then should look like this:

{
	"scripts": {
		"test": "electron-ava"
	},
	"devDependencies": {
		"electron-ava": "^0.1.0"
	},
	"electron-ava": {
		"renderer": true
	}
}

Window options

If you want to pass options to the browser window for the renderer process, you can do this by adding the windowOptions option to your config. This object will then be passed to the BrowserWindow constructor.

For example, if you want to have with the title My fancy tests, you could update your package.json to look like this:

{
	"scripts": {
		"test": "electron-ava"
	},
	"devDependencies": {
		"electron-ava": "^0.1.0"
	},
	"electron-ava": {
		"renderer": true,
		"windowOptions": {
			"title": "My fancy tests"
		}
	}
}