Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 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: 

This comment has been minimized.

Copy link

@aaronabramov aaronabramov commented Jul 4, 2019

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


This comment has been minimized.

Copy link

@agilgur5 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 join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.