Jest-puppeteer: Stuck on trying to run tests non-headless

Created on 8 Mar 2019  ·  2Comments  ·  Source: smooth-code/jest-puppeteer

Heya

Im evaluating jest-puppeteer. and so im running the example.

It runs smoothly as is. but im now trying to run the test non-headless/headfull (?) and i get stuck.

i simply added the following as found in the README.md:

module.exports = {
  preset: 'jest-puppeteer',
  testRegex: './*\\.test\\.js$',
  launch: {
    headless: false
 },
  browserContext: 'default',
}

this triggers a bunch of validation warnings and stil run the tests headless:

● Validation Warning:

  Unknown option "launch" with value {"headless": true} was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

● Validation Warning:

  Unknown option "browserContext" with value "default" was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

Im pretty new to al this, so excuse any stupidity on my part, but I thought id share my troubles.

question ❓

Most helpful comment

@midgethoen

try this

// jest-puppeteer.config.js
module.exports = {
  launch: {
    headless: false
 },
  browserContext: 'default',
}
// jest.config.js
module.exports = {
  preset: 'jest-puppeteer',
  testRegex: './*\\.test\\.js$',
}

All 2 comments

Hello @midgethoen, you mixed the jest-puppeteer.config.js and the jest configuration. It is two separated files. You should give another look to the documentation.

@midgethoen

try this

// jest-puppeteer.config.js
module.exports = {
  launch: {
    headless: false
 },
  browserContext: 'default',
}
// jest.config.js
module.exports = {
  preset: 'jest-puppeteer',
  testRegex: './*\\.test\\.js$',
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Greg-oliver99 picture Greg-oliver99  ·  4Comments

joshpitzalis picture joshpitzalis  ·  3Comments

testerez picture testerez  ·  6Comments

Pyrolistical picture Pyrolistical  ·  6Comments

xiaoyuhen picture xiaoyuhen  ·  5Comments