Socket
Socket
Sign inDemoInstall

jest-electron

Package Overview
Dependencies
522
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jest-electron

Easiest way to run jest unit test cases in electron.


Version published
Weekly downloads
927
increased by1.98%
Maintainers
1
Install size
191 MB
Created
Weekly downloads
 

Readme

Source

jest-electron

Easiest way to run jest unit test cases in electron.

Build Status npm npm

Usage

  • Install
npm i --save-dev jest-electron
  • Add to Jest config

In your package.json

{
  "jest": {
+    "runner": "jest-electron/runner",
+    "testEnvironment": "jest-electron/environment"
  }
}

Notice: update the runner configure, not testRunner.

  • Update .travis.yml
language: node_js
node_js:
  - "8"
  - "9"
  - "10"
  - "11"
  - "12"
+ addons:
+   apt:
+     packages:
+       - xvfb
+ install:
+   - export DISPLAY=':99.0'
+   - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
+   - npm install
script:
  - npm run test

Debugger mode

Keep the electron browser window for debugging. set env INTERACTIVE=1.

INTERACTIVE=1 jest

License

MIT@hustcc.

FAQs

Last updated on 15 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc