Skip to content

Commit

Permalink
feat: back to playwright-core dep
Browse files Browse the repository at this point in the history
- simpler, as it won't require yarn users to install both playwright AND worry about getting the browser installed (either via `@playwright/browser-chromium` or `npx playwright install --with-deps`).
- npm users didn't worry about it, as newer npm verisons installed peerdeps for them.
- playwright-core seems to have the benefit of not optionally depending on fsevents, so use that again.
- might revise again in the future if they drop playwright-core (considering the playwright package no longer installs browsers by default).
  • Loading branch information
AviVahl committed Oct 23, 2023
1 parent f616887 commit e1cd594
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Install `mocha-play` as a dev dependency:
npm i mocha-play --save-dev
```

`mocha-play` expects `mocha`, `playwright`, and `webpack` to also be installed in the project.
`mocha-play` expects `mocha`, `@playwright/browser-chromium`, and `webpack` to also be installed in the project.

## Usage

Expand Down
36 changes: 1 addition & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"peerDependencies": {
"mocha": ">=7",
"playwright": ">=1.39.0",
"webpack": "^5.0.0"
},
"dependencies": {
Expand All @@ -33,6 +32,7 @@
"find-up": "^6.3.0",
"glob": "^10.3.10",
"html-webpack-plugin": "^5.5.3",
"playwright-core": "^1.39.0",
"webpack-dev-middleware": "^6.1.1"
},
"devDependencies": {
Expand All @@ -48,7 +48,6 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"mocha": "^10.2.0",
"playwright": "^1.39.0",
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"typescript": "~5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { pathToFileURL, URL } from 'url';
import { Command } from 'commander';
import { globSync } from 'glob';
import type webpack from 'webpack';
import type playwright from 'playwright';
import type playwright from 'playwright-core';
import { findUpSync } from 'find-up';
import { runTests } from './run-tests.js';

Expand Down
2 changes: 1 addition & 1 deletion src/hook-page-console.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type playwright from 'playwright';
import type playwright from 'playwright-core';

/**
* Hooks the console of a `playwright.Page` to Node's console,
Expand Down
2 changes: 1 addition & 1 deletion src/run-tests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createRequire } from 'module';
import path from 'path';
import express from 'express';
import playwright from 'playwright';
import playwright from 'playwright-core';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import HtmlWebpackPlugin from 'html-webpack-plugin';
Expand Down

0 comments on commit e1cd594

Please sign in to comment.