Comments (8)
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.
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.
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.
@callumlocke Can you please share the configuration that you made to work jest with puppetter ?
from jest-puppeteer.
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.
Add @jest-environment puppeteer
docblock on top of your test file:
/**
* @jest-environment puppeteer
*/
https://jestjs.io/docs/configuration#testenvironment-string
from jest-puppeteer.
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.
You are right, done!
from jest-puppeteer.
Related Issues (20)
- JSHandle@node is not supported HOT 6
- `spawnd` package should have `exit` as a dependency, not a devDependency
- Dependency Errors Using `npm i` HOT 2
- Cannot find module 'node:stream' on fresh install HOT 1
- Compiler errors importing `JestPuppeteerConfig` interface HOT 2
- Compiler errors extending `PuppeteerEnvironment`
- Compiler errors accessing `PuppeteerEnvironment` globals HOT 1
- Jest preset not working with latest jest and jest-puppeteer HOT 6
- Snapshot serializers added with `expect.addSnapshotSerializer` are not used HOT 3
- Remove Warning On New Headless Setting HOT 5
- Many browser windows open when running tests HOT 4
- [jest-dev-server] not working server.usedPortAction: 'ignore' config when running React application with react-scripts
- Invariant: WORKERS_COUNT not found HOT 4
- @types/expect-puppeteer no such type toMatchTextContent HOT 1
- Using jest-puppeteer with nx HOT 4
- How can I launch jest-puppeteer with args? HOT 1
- Regression: `injectGlobals:false` no longer supported ("Cannot convert undefined or null to object") HOT 1
- Puppeteer 21 regression: `[object Object] is not supported` HOT 4
- Is @types/jest-environment-puppeteer still required? HOT 5
- jest-dev-server - "kill" missing in "usedPortAction" type definition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest-puppeteer.