Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for Node.js v22-23 #608

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ process.env.TEST_SERVER_PORT = port;
const jestPuppeteerConfig = {
launch: {
headless: "new",
args: ["--no-sandbox"],
},
browserContext: process.env.INCOGNITO ? "incognito" : "default",
server: {
Expand Down
Loading
Loading