Skip to content

Commit b78deec

Browse files
committed
build: Use node 22
1 parent 5225f57 commit b78deec

12 files changed

+1798
-2394
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Description
2+
3+
<!--
4+
Describe the big picture of your changes here to communicate to the maintainers
5+
why we should accept this pull request. If it fixes a bug or resolves a feature
6+
request, be sure to link to that issue.
7+
-->

.github/workflows/release.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ on:
44
workflow_dispatch:
55
inputs:
66
releaseType:
7-
description: 'Release type - major, minor or patch'
7+
description: "Release type - major, minor, or patch"
88
required: false
9-
default: 'patch'
9+
default: "patch"
1010

1111
jobs:
1212
publish-release:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
ref: ${{ github.ref }}
1919
fetch-depth: 0
2020

2121
- name: Setup Node
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
24-
node-version-file: '.nvmrc'
25-
cache: 'npm'
24+
node-version-file: ".nvmrc"
25+
cache: "npm"
2626

2727
- name: Install Dependencies
2828
run: npm ci
@@ -33,11 +33,10 @@ jobs:
3333
git config --global user.email "[email protected]"
3434
3535
- name: Login to NPM
36-
run: npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
36+
run: npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
3737

3838
- name: Release
3939
run: npm run release:ci -- ${{ github.event.inputs.releaseType }}
4040
env:
41-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
42-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
43-
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Setup Node
16-
uses: actions/setup-node@v3
16+
uses: actions/setup-node@v4
1717
with:
18-
node-version-file: '.nvmrc'
19-
cache: 'npm'
18+
node-version-file: ".nvmrc"
19+
cache: "npm"
2020

2121
- name: Install Dependencies
2222
run: npm ci
@@ -28,19 +28,19 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v3
31+
uses: actions/checkout@v4
3232

3333
- name: Setup Node
34-
uses: actions/setup-node@v3
34+
uses: actions/setup-node@v4
3535
with:
36-
node-version-file: '.nvmrc'
37-
cache: 'npm'
36+
node-version-file: ".nvmrc"
37+
cache: "npm"
3838

3939
- name: Install Dependencies
4040
run: npm ci
4141

4242
- name: Test
4343
run: npm test
4444
env:
45-
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
46-
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
45+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
46+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20
1+
v22

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
11
# sauce-playwright-plugin
22

3-
This Playwright plugins reports each project to your Sauce Labs account.
3+
This Playwright plugin reports each project to your Sauce Labs account.
44

55
## Installation
66

77
Install from npm:
8-
```
8+
```sh
99
npm install @saucelabs/playwright-reporter
1010
```
1111

12-
### Sauce Labs credentials
13-
14-
`SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables needs to be set to
15-
allow the plugin to report your results to Sauce Labs.
16-
Your Sauce Labs Username and Access Key are available from your
17-
[dashboard](https://app.saucelabs.com/user-settings).
12+
### Sauce Labs Credentials
1813

14+
Set the `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables to allow the plugin to report your results to Sauce Labs. Your Sauce Labs Username and Access Key are available from your [dashboard](https://app.saucelabs.com/user-settings).
1915

2016
## Usage
2117

22-
Add to default reporter:
23-
```
24-
npx playwright test --reporter=line,@saucelabs/playwright-reporter
18+
Add to the default reporter:
19+
```sh
20+
npx playwright test --reporter=line,@saucelabs/playwright-reporter
2521
```
2622

2723
Use only `@saucelabs/playwright-reporter`:
28-
```
29-
npx playwright test --reporter=@saucelabs/playwright-reporter
24+
```sh
25+
npx playwright test --reporter=@saucelabs/playwright-reporter
3026
```
3127

32-
You can also configure using `playwright.config.js`. To achieve that, add `'@saucelabs/playwright-reporter'` to the reporter section of your configuration:
33-
```
28+
You can also configure it using `playwright.config.js`. To do that, add `'@saucelabs/playwright-reporter'` to the reporter section of your configuration:
29+
```js
3430
const config = {
3531
reporter: [
3632
['@saucelabs/playwright-reporter'],
@@ -39,12 +35,12 @@ const config = {
3935
};
4036
```
4137

42-
### Plugin configuration
38+
### Plugin Configuration
4339

44-
`@saucelabs/playwright-plugin` is configurable through your `playwright.config.js` or `playwright.config.ts` file.
40+
`@saucelabs/playwright-reporter` is configurable through your `playwright.config.js` or `playwright.config.ts` file.
4541

4642
Example:
47-
```
43+
```js
4844
const config = {
4945
reporter: [
5046
['@saucelabs/playwright-reporter', {
@@ -60,32 +56,36 @@ const config = {
6056
};
6157
```
6258

63-
| Name | Description | Kind |
64-
|----------------|--------------------------------------------------------------------------------------------------|------------------------------|
65-
| `build` | Sets a build ID. <br> Default: `''` | `String` |
66-
| `tags` | Tags to add to the uploaded Sauce job. <br> Default: `[]` | `String[]` |
67-
| `region` | Sets the region. <br> Default: `us-west-1` | `us-west-1` \| `eu-central-1`|
68-
| `upload` | Whether to upload report and assets to Sauce <br> Default: `true` | `boolean` |
69-
| `outputFile` | The local path to write the sauce test report. Can be set in env var `SAUCE_REPORT_OUTPUT_NAME`. | `String` |
59+
| Name | Description | Type |
60+
|--------------|--------------------------------------------------------------------------------------------------|--------------------------------|
61+
| `buildName` | Sets a build ID. <br> Default: `''` | `string` |
62+
| `tags` | Tags to add to the uploaded Sauce job. <br> Default: `[]` | `string[]` |
63+
| `region` | Sets the region. <br> Default: `us-west-1` | `us-west-1` \| `eu-central-1` |
64+
| `upload` | Whether to upload report and assets to Sauce Labs. <br> Default: `true` | `boolean` |
65+
| `outputFile` | The local path to write the Sauce test report. Can be set in env var `SAUCE_REPORT_OUTPUT_NAME`. | `string` |
7066

7167
## Limitations
7268

73-
Some limitations applies to `@saucelabs/playwright-reporter`:
74-
* Before playwright@v1.16.3, Playwright version is not reported to Sauce Labs.
75-
* Browser version is not reported to Sauce Labs.
69+
Some limitations apply to `@saucelabs/playwright-reporter`:
70+
* For Playwright versions before v1.16.3, the Playwright version is not reported to Sauce Labs.
71+
* The browser version is not reported to Sauce Labs.
7672

7773
## Development
7874

79-
### Running locally
75+
### Running Locally
8076

81-
In order to test the reporter, you'll need to link it to itself then run a test with the reporter set.
77+
To test the reporter locally, link it to itself and then run a test with the reporter set.
8278

83-
```
79+
```sh
8480
$ npm link
8581
$ npm link @saucelabs/playwright-reporter
8682
$ npx playwright test --reporter=@saucelabs/playwright-reporter
8783
```
8884

8985
### Debug
9086

91-
Once you `npm link`, you can run your playwright tests with the environment variable `DEBUG="@saucelabs/playwright-reporter:*"` to see additional debug output.
87+
After linking with `npm link`, you can run your Playwright tests with the environment variable `DEBUG="@saucelabs/playwright-reporter:*"` to see additional debug output.
88+
89+
```sh
90+
$ DEBUG="@saucelabs/playwright-reporter:*" npx playwright test --reporter=@saucelabs/playwright-reporter
91+
```

eslint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const ts = require('typescript-eslint');
2+
const js = require('@eslint/js');
3+
const prettier = require('eslint-config-prettier');
4+
const jest = require('eslint-plugin-jest');
5+
6+
module.exports = ts.config(
7+
js.configs.recommended,
8+
...ts.configs.recommended,
9+
prettier,
10+
{
11+
plugins: {
12+
jest: jest,
13+
},
14+
rules: {
15+
'no-undef': 'off',
16+
},
17+
},
18+
{
19+
ignores: ['lib/**'],
20+
},
21+
{
22+
files: ['**/*.js', '**/*.ts'],
23+
rules: {
24+
'@typescript-eslint/no-explicit-any': 'warn',
25+
'@typescript-eslint/no-var-requires': 'off',
26+
},
27+
},
28+
{
29+
languageOptions: {
30+
globals: {
31+
__dirname: true,
32+
console: true,
33+
exports: true,
34+
module: true,
35+
require: true,
36+
},
37+
},
38+
},
39+
);

0 commit comments

Comments
 (0)