1. xvfb-maybe
Runs xvfb-run only if you need to, useful for Electron unit tests
xvfb-maybe
Package: xvfb-maybe
Created by: paulcbetts
Last modified: Wed, 29 Jun 2022 06:17:18 GMT
Version: 0.2.1
License: MIT
Downloads: 114,369
Repository: https://github.com/paulcbetts/xvfb-maybe

Install

npm install xvfb-maybe
yarn add xvfb-maybe

xvfb-maybe

This package runs an arbitrary executable / args under xvfb-run if the
platform is Linux and DISPLAY isn't set. This is super useful for making
Electron unit tests run correctly in CI environments while still working
locally

Usage:

 ## On Windows or OS X, this just invokes electron-mocha
## On Linux, if we are in a headless environment, this will be equivalent 
## to xvfb-run electron-mocha ./test/*.js
xvfb-maybe electron-mocha ./test/*.js

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code