Skip to content

Commit

Permalink
feat: add support for Node.js v22-23
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Node.js v16 is not supported
  • Loading branch information
gregberge committed Dec 21, 2024
1 parent 911b243 commit f1e33a1
Show file tree
Hide file tree
Showing 13 changed files with 1,239 additions and 1,252 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18, 20, "latest"]
node-version: [18, 20, 22, "latest"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ You can easily customize the Puppeteer instance used in your tests by modifying
```js
module.exports = {
launch: {
product: "firefox",
browser: "firefox",
headless: process.env.HEADLESS !== "false",
},
};
Expand Down Expand Up @@ -284,7 +284,7 @@ You can further extend this configuration to connect to a remote instance of Chr

Jest-Puppeteer exposes several global objects and methods to facilitate test writing:

- **`global.browser`**: Provides access to the Puppeteer [Browser](https://pptr.dev/#?product=Puppeteer&version=v13.0.0&show=api-class-browser) instance.
- **`global.browser`**: Provides access to the Puppeteer [Browser](https://pptr.dev/api/puppeteer.browser/) instance.

Example:

Expand All @@ -293,15 +293,15 @@ Jest-Puppeteer exposes several global objects and methods to facilitate test wri
await page.goto("https://example.com");
```

- **`global.page`**: The default Puppeteer [Page](https://pptr.dev/#?product=Puppeteer&version=v13.0.0&show=api-class-page) object, automatically created and available in tests.
- **`global.page`**: The default Puppeteer [Page](https://pptr.dev/api/puppeteer.page/) object, automatically created and available in tests.

Example:

```js
await page.type("#input", "Hello World");
```

- **`global.context`**: Gives access to the [browser context](https://pptr.dev/#?product=Puppeteer&version=v13.0.0&show=api-class-browsercontext), useful for isolating tests in separate contexts.
- **`global.context`**: Gives access to the [browser context](https://pptr.dev/api/puppeteer.browsercontext/), useful for isolating tests in separate contexts.

- **`global.expect(page)`**: The enhanced `expect` API provided by `expect-puppeteer`. You can use this to make assertions on the Puppeteer `page`.

Expand Down
Loading

0 comments on commit f1e33a1

Please sign in to comment.