Skip to content

Commit 7ffe561

Browse files
committed
Add missed comma in utils.js
1 parent 76f41d9 commit 7ffe561

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,32 @@ Update your Jest configuration:
1616
}
1717
```
1818

19-
You should provide **browser** option as environment variable:
19+
## Configuration
2020

21+
You can specify a `jest-playwright.config.js` at the root of the project or define a custom path using `JEST_PLAYWRIGHT_CONFIG` environment variable. It should export a config object.
22+
23+
- `launchBrowserApp` <[object]> [All Playwright launch options](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsertypelaunchbrowserappoptions) can be specified in config. Since it is JavaScript, you can use all stuff you need, including environment.
24+
- `context` <[object]> [All Playwright context options](https://github.com/microsoft/playwright/blob/master/docs/api.md#browsernewcontextoptions) can be specified in config.
25+
- `browser` <[string]>. Define a [browser](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browsertype) to run tests into.
26+
- `chromium` Each test runs Chromium.
27+
- `firefox` Each test runs Firefox.
28+
- `webkit` Each test runs Webkit.
29+
- `exitOnPageError` <[boolean]> Exits page on any global error message thrown. Defaults to `true`.
30+
31+
## Browser type
32+
33+
You can specify browser in multiple ways:
34+
35+
- With `BROWSER` environment variable
36+
- With your `jest-playwright.config.js`
37+
38+
If you don't pass any value it will be use `chromium` as default
2139

2240
Use Playwright in your tests:
2341
```json
2442
"test": "BROWSER=chromium jest"
2543
```
2644

27-
2845
```js
2946
describe('Google', () => {
3047
beforeAll(async () => {

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function readConfig() {
2626
const hasCustomConfigPath = !!process.env.JEST_PLAYWRIGHT_CONFIG;
2727
const configPath =
2828
process.env.JEST_PLAYWRIGHT_CONFIG || 'jest-playwright.config.js';
29-
const absConfigPath = path.resolve(process.cwd(), configPath)
29+
const absConfigPath = path.resolve(process.cwd(), configPath);
3030
const configExists = await exists(absConfigPath);
3131

3232
if (hasCustomConfigPath && !configExists) {

0 commit comments

Comments
 (0)