---
url: https://huldoser.github.io/test-inventory/frameworks/jest-examples.md
description: Scan Puppeteer suites running on Jest with test-inventory.
---

# Jest examples

These examples use Jest throughout. Start with the [Jest guide](/frameworks/jest) for installation,
your first scan and framework-specific limits. Each example shows a project's file layout; adjust its globs to
your own suite. Scanning reads the source without running tests or starting a browser.

## Puppeteer on Jest

Puppeteer has no test runner of its own; its end-to-end suites run on Jest through the `jest-puppeteer` preset, which
gives the tests a `page` and `browser`, and `expect(page)` matchers:

```js excerpt
// e2e/order-ticket.e2e.js
describe('order ticket', () => {
  beforeEach(async () => {
    await page.goto(`${BASE_URL}/trade/AAPL`);
  });
  // ...
  it.each([
    ['0', 'Quantity must be at least 1'],
    ['-5', 'Quantity must be at least 1'],
    ['1000001', 'Quantity is above the 1,000,000 share limit'],
  ])('rejects a quantity of %s', async (quantity, message) => {
```

```sh
npx test-inventory "e2e/**/*.e2e.js" --framework jest --output inventory.json
```

The preset only sets up the browser, so the scan reads the file as any Jest file, with no warning about it:

```json
{
  "fullName": "order ticket > rejects a quantity of %s",
  "caseCount": 3,
  "tags": ["e2e/order-ticket"],
  "timeout": 30000,
  "timeoutSource": "config"
}
```

## Next

* [Jest configuration and limits](/frameworks/jest#configuration-and-limits).
* [Query recipes](/guide/recipes): filter by state, tags and other fields.
* [All framework guides](/frameworks/): scan another runner in the same project.
