Jest-puppeteer: Where to specify puppeteer.use()?

Created on 10 Jul 2019  ·  4Comments  ·  Source: smooth-code/jest-puppeteer

Could be a newbie question, or i've overlooked the readme - but I'm trying to add a puppeteer-extra plugin, i would like to know how to set up puppeteer since we are using jest-puppeteer.config.js?

Example:

// Add stealth plugin and use defaults (all tricks to hide puppeteer usage)
const StealthPlugin = require("puppeteer-extra-plugin-stealth")
puppeteer.use(StealthPlugin()) 
question ❓

All 4 comments

It is not yet supported, sorry.

When will this be supported? it's been a long time now.

it's gonna be quite helpful

You can use puppeteer-extra with jest-puppeteer by putting this in jest-puppeteer.config.js:

const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
puppeteer.use(StealthPlugin());

require.cache[require.resolve('puppeteer')] =
  require.cache[require.resolve('puppeteer-extra')];
Was this page helpful?
0 / 5 - 0 ratings

Related issues

songguohfut picture songguohfut  ·  6Comments

alexander-elgin picture alexander-elgin  ·  4Comments

testerez picture testerez  ·  6Comments

rodoabad picture rodoabad  ·  3Comments

lakesare picture lakesare  ·  3Comments