Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Run tests using Jest & Puppeteer 🎪✨
| Date | Stars |
|---|---|
| 2026-07-24 | 3546 |
| 2026-07-25 | 3546 |
| 2026-07-28 | 3546 |
| 2026-07-30 | 3546 |
| 2026-08-06 | 3546 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# 🎪 jest-puppeteer
[](https://www.npmjs.com/package/jest-puppeteer)
[](https://www.npmjs.com/package/jest-puppeteer)
`jest-puppeteer` is a Jest preset designed for seamless integration with Puppeteer, enabling end-to-end testing in a browser environment. With a simple API, it allows you to launch browsers and interact with web pages, making it perfect for testing UI interactions in web applications.
## Table of Contents
1. [Getting Started](#getting-started)
- [Installation](#installation)
- [Basic Setup](#basic-setup)
- [Writing Your First Test](#writing-your-first-test)
- [TypeScript Setup](#typescript-setup)
- [Visual Testing with Argos](#visual-testing-with-argos)
2. [Recipes](#recipes)
- [Using `expect-puppeteer`](#using-expect-puppeteer)
- [Debugging Tests](#debugging-tests)
- [Automatic Server Management](#automatic-server-management)
- [Customizing the Puppeteer Instance](#customizing-the-puppeteer-instance)
- [Custom Test Setup](#custom-test-setup)
- [Extending `PuppeteerEnvironment`](#extending-puppeteerenvironment)
- [Global Setup and Teardown](#global-setup-and-teardown)
3. [Jest-Puppeteer Configuration](#jest-puppeteer-configuration)
4. [API Reference](#api-reference)
5. [Troubleshooting](#troubleshooting)
6. [Acknowledgements](#acknowledgements)
## Getting Started
### Installation
To start using `jest-puppeteer`, you’ll need to install the following packages:
```bash
npm install --save-dev jest-puppeteer puppeteer jest
```
This will install Jest (the testing framework), Puppeteer (the headless browser tool), and `jest-puppeteer` (the integration between the two).
### Basic Setup
In your Jest configuration file (`jest.config.js`), add `jest-puppeteer` as the preset:
```json
{
"preset": "jest-puppeteer"
}
```
This will configure Jest to use Puppeteer for running your tests. Make sure to remove any conflicting `testEnvironment` settings that might be present in your existing Jest configuration, as `jest-puppeteer` manages the environment for you.
### Writing Your First Test
Once you’ve configured Jest, you can start writing tests using Puppeteer’s `page` object, which is automatically provided by `jest-puppeteer`.
Create a test file (e.g., `google.test.js`):
```js
import "expect-puppeteer";
describe("Google Homepage", () => {
beforeAll(async () => {
await page.goto("https://google.com");
});
it('should display "google" text on page', async () => {
await expect(page).toMatchTextContent(/Google/);
});
});
```
This example test navigates to Google’s homepage and checks if the page contains the word "Google". `jest-puppeteer` simplifies working with Puppeteer by exposing the `page` object, allowing you to write tests using a familiar syntax.
### TypeScript Setup
If you’re using TypeScript, `jest-puppeteer` natively supports it from version `8.0.0`. To get started with TypeScript, follow these steps:
1. Make sure your project is using the correct type definitions. If you’ve upgraded to version `10.1.2` or above, uninstall old types:
```bash
npm uninstall --save-dev @types/jest-environment-puppeteer @types/expect-puppeteer
```
2. Install `@types/jest` (`jest-puppeteer` does not support `@jest/globals`) :
```bash
npm install --save-dev @types/jest
```
3. Jest will automatically pick up type definitions from `@types/jest`. Once you’ve set up the environment, you can start writing tests in TypeScript just like in JavaScript:
```ts
import "jest-puppeteer";
import "expect-puppeteer";
describe("Google Homepage", (): void => {
beforeAll(async (): Promise<void> => {
await page.goto("https://google.com");
});
it('should display "google" text on page', async (): Promise<void> => {
await expect(page).toMatchTextContent(/Google/);
});
});
```
### Visual Testing with Argos
[Argos](https://argos-ci.com) is a Excerpt of 12,203 characters
Read on GitHubGreg Bergé · Argos · France
212
46
Tony Brix · @Google · United States
42
16
Colin Rotherham · Colin Rotherham Design · United Kingdom
8
Gideon Pyzer · United Kingdom
5
France
3
2
Bogdan Chadkin · @webstudio-is
2
2
lc
2
Donovan Graham
2
2
Tanguy Krotoff · @Decathlon · France
1
1
Mohsen Azimi
1
1
Ryan Koval · United States
1
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:c7231c893162ce56, topic:puppeteer, readme:headless browser