GithubHelp home page GithubHelp logo

Comments (8)

FSPinho avatar FSPinho commented on August 24, 2024 22

I fixed that by reading again the DOC

NOTE: Be sure to remove any existing testEnvironment option from your Jest configuration. The jest-puppeteer preset needs to manage that option itself.

from jest-puppeteer.

callumlocke avatar callumlocke commented on August 24, 2024 3

I'm not sure if 5 months is a long time at all. I'm sure a lot of slow-moving corporate codebases are still on Jest 21 or older. Would it be a problem to add the words "Requires Jest 22 or higher" in the readme (maybe in the same blockquote that recommends additional typescript-related packages)? That would have saved me a few hours yesterday.

from jest-puppeteer.

zeropaper avatar zeropaper commented on August 24, 2024 3

I've setup my environment according to the documentation available here: https://jestjs.io/docs/en/puppeteer but faced the problem.
After trying some things I discovered that actually, nowadays, the right way to setup is to use jest-environment-puppeteer as described here:
https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer
and created a PR jestjs/jest#8882

from jest-puppeteer.

LalitKushwah avatar LalitKushwah commented on August 24, 2024 1

@callumlocke Can you please share the configuration that you made to work jest with puppetter ?

from jest-puppeteer.

AntonAL avatar AntonAL commented on August 24, 2024 1

For me, a standard jest-puppeteer is working fine.

In case, when somebody still have this issue, here is a general advice.
Verify, whether a configuration file jest.config.js (or whatever name) is actually get's executed. Just make intentionaly some syntax error in this file and take look at the console output, when staring jest.
So, if everything looks, like config file is not get's executed, check, whether it's name is passed in starting command, like this:

jest integration --config=jest.config.js

from jest-puppeteer.

mirismaili avatar mirismaili commented on August 24, 2024 1

Add @jest-environment puppeteer docblock on top of your test file:

/**
 * @jest-environment puppeteer
 */

https://jestjs.io/docs/configuration#testenvironment-string

from jest-puppeteer.

gregberge avatar gregberge commented on August 24, 2024

Thanks for spotting it, I prefer to not add Jest in peer dependencies. Jest 22 has been released 5 months ago. I think we don't have to mention it. Your issue will be the answer.

from jest-puppeteer.

gregberge avatar gregberge commented on August 24, 2024

You are right, done!

from jest-puppeteer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.