Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

It's not working in Gitlab CI Server #47

wongjiahau opened this issue Jul 4, 2019 · 2 comments

It's not working in Gitlab CI Server #47

wongjiahau opened this issue Jul 4, 2019 · 2 comments


Copy link

wongjiahau commented Jul 4, 2019


// jest.config.js
module.exports = {
  "roots": [
  "transform": {
    "^.+\\.tsx?$": "ts-jest"
  runner: '@jest-runner/electron',
  testEnvironment: '@jest-runner/electron/environment',

Docker image


What happened?

The log below is shown after running the jest command, and then it remained hanging and nothing happened after that, no output at all.

> jest --maxWorkers=1

(process:4814): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.

(electron:4814): Gtk-WARNING **: cannot open display: 
Copy link

hey @wongjiahau! running electron (or electron tests) require a display (or virtual display), and it seems like your CI server does not support it, hence you get the message

(electron:4814): Gtk-WARNING **: cannot open display:

you can try using another docker image (see circleci configuration for this repo)

or you can play with things like xvfb to configure a virtual display

Copy link

agilgur5 commented Nov 26, 2019

Ran into a similar issue on Travis CI -- it would also hang, but it didn't print any errors while it waited, which was quite confusing.

For any future readers, I fixed it by following the links at d4rkr00t/jest-electron-runner#5 (comment).

My Travis CI config looks a bit like this:

language: node_js
node_js: '10.16.0'

# cache folder with Electron binary (
    - ~/.cache

# run with xvfb bc it's needed for Electron (
script: xvfb-run npm test

The caching part isn't mentioned in the Travis headless docs or the Electron headless CI docs, but it is mentioned in Electron's installation docs.

Hopefully this helps some folks! It might be worthwhile to officially document this for anyone who isn't knowledgeable about Electron + CI configuration. Can send a PR if this is agreed to be something that warrants officially documentation!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

3 participants