jest-puppeteer icon indicating copy to clipboard operation
jest-puppeteer copied to clipboard

Tests don't fail when server command crash

Open amiramw opened this issue 5 years ago • 0 comments

🐛 Bug Report

When using the capability to start server before test run there is a problem that if server crashes or if server finishes immediately the tests don't run and finish with exit code 0. As a result any CI running the UI tests doesn't fail.

To Reproduce

Steps to reproduce the behavior:

Expected behavior

With the following jest-puppeteer.config.js file the server command start finish immediately.

module.exports = {
  exitOnPageError: false,
  launch: {
    // headless: false,
    // devtools: true
  },
  server: {
    command:
      "echo hello",
    port: 4444,
    launchTimeout: 30000
  }
};

Any tests in the projects are not run and the test run finishes with exit code 0.

I would expect the exit code to not be 0 if no tests has run.

Link to repo

https://github.com/amiramw/jest-puppeteer-server-bug

To reproduce run: yarn && yarn test

System

## System:
 - OS: Windows 10
 - CPU: (8) x64 Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz
 - Memory: 7.32 GB / 31.85 GB
## Binaries:
 - Node: 10.15.3 - C:\Program Files\nodejs\node.EXE
 - Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
 - npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD

amiramw avatar Jul 08 '19 10:07 amiramw