Skip to content

Commit 21b00d0

Browse files
authored
test: roll to [email protected] (#6897)
1 parent 85786b1 commit 21b00d0

File tree

7 files changed

+30
-29
lines changed

7 files changed

+30
-29
lines changed

docs/src/test-reporters.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ You can use different reporters locally and on CI.
3939
// playwright.config.js
4040
module.exports = {
4141
reporter: !process.env.CI
42-
// A list of tests for the terminal
42+
// Default 'list' reporter for the terminal
4343
? 'list'
44-
// Very concise "dot" reporter and a comprehensive json report for CI
45-
: ['dot', { name: 'json', outputFile: 'test-results.json' }],
44+
// Two reporters for CI:
45+
// - concise "dot"
46+
// - comprehensive json report
47+
: [ ['dot'], [ 'json', { outputFile: 'test-results.json' }] ],
4648
};
4749
```
4850

@@ -51,11 +53,12 @@ module.exports = {
5153
import { PlaywrightTestConfig } from '@playwright/test';
5254

5355
const config: PlaywrightTestConfig = {
54-
reporter: !process.env.CI
55-
// A list of tests for the terminal
56+
// Default 'list' reporter for the terminal
5657
? 'list'
57-
// Very concise "dot" reporter and a comprehensive json report for CI
58-
: ['dot', { name: 'json', outputFile: 'test-results.json' }],
58+
// Two reporters for CI:
59+
// - concise "dot"
60+
// - comprehensive json report
61+
: [ ['dot'], [ 'json', { outputFile: 'test-results.json' }] ],
5962
};
6063
export default config;
6164
```
@@ -190,7 +193,7 @@ In configuration file, pass options directly:
190193
```js js-flavor=js
191194
// playwright.config.js
192195
module.exports = {
193-
reporter: { name: 'json', outputFile: 'results.json' },
196+
reporter: [ ['json', { outputFile: 'results.json' }] ],
194197
};
195198
```
196199

@@ -199,7 +202,7 @@ module.exports = {
199202
import { PlaywrightTestConfig } from '@playwright/test';
200203

201204
const config: PlaywrightTestConfig = {
202-
reporter: { name: 'json', outputFile: 'results.json' },
205+
reporter: [ ['json', { outputFile: 'results.json' }] ],
203206
};
204207
export default config;
205208
```
@@ -217,7 +220,7 @@ In configuration file, pass options directly:
217220
```js js-flavor=js
218221
// playwright.config.js
219222
module.exports = {
220-
reporter: { name: 'junit', outputFile: 'results.xml' },
223+
reporter: [ ['junit', { outputFile: 'results.xml' }] ],
221224
};
222225
```
223226

@@ -226,7 +229,7 @@ module.exports = {
226229
import { PlaywrightTestConfig } from '@playwright/test';
227230

228231
const config: PlaywrightTestConfig = {
229-
reporter: { name: 'junit', outputFile: 'results.xml' },
232+
reporter: [ ['junit', { outputFile: 'results.xml' }] ],
230233
};
231234
export default config;
232235
```

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"eslint-plugin-notice": "^0.9.10",
8181
"eslint-plugin-react-hooks": "^4.2.0",
8282
"file-loader": "^6.1.0",
83-
"folio": "=0.4.0-alpha26",
83+
"folio": "=0.4.0-alpha27",
8484
"formidable": "^1.2.2",
8585
"html-webpack-plugin": "^4.4.1",
8686
"ncp": "^2.0.0",

src/cli/testRunner.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const tsConfig = 'playwright.config.ts';
3030
const jsConfig = 'playwright.config.js';
3131
const defaultConfig: Config = {
3232
preserveOutput: process.env.CI ? 'failures-only' : 'always',
33-
reporter: [defaultReporter],
33+
reporter: [ [defaultReporter] ],
3434
timeout: defaultTimeout,
3535
updateSnapshots: process.env.CI ? 'none' : 'missing',
3636
workers: Math.ceil(require('os').cpus().length / 2),
@@ -167,9 +167,7 @@ function overridesFromOptions(options: { [key: string]: any }): Config {
167167
quiet: options.quiet ? options.quiet : undefined,
168168
repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : undefined,
169169
retries: options.retries ? parseInt(options.retries, 10) : undefined,
170-
reporter: (options.reporter && options.reporter.length) ? options.reporter.split(',').map((r: string) => {
171-
return builtinReporters.includes(r) ? r : { require: r };
172-
}) : undefined,
170+
reporter: (options.reporter && options.reporter.length) ? options.reporter.split(',').map((r: string) => [r]) : undefined,
173171
shard: shardPair ? { current: shardPair[0] - 1, total: shardPair[1] } : undefined,
174172
timeout: isDebuggerAttached ? 0 : (options.timeout ? parseInt(options.timeout, 10) : undefined),
175173
updateSnapshots: options.updateSnapshots ? 'all' as const : undefined,

tests/config/android.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
3232
forbidOnly: !!process.env.CI,
3333
retries: process.env.CI ? 1 : 0,
3434
reporter: process.env.CI ? [
35-
'dot',
36-
{ name: 'json', outputFile: path.join(outputDir, 'report.json') },
35+
[ 'dot' ],
36+
[ 'json', { outputFile: path.join(outputDir, 'report.json') } ],
3737
] : 'line',
3838
projects: [],
3939
};

tests/config/default.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
5454
forbidOnly: !!process.env.CI,
5555
retries: process.env.CI ? 3 : 0,
5656
reporter: process.env.CI ? [
57-
'dot',
58-
{ name: 'json', outputFile: path.join(outputDir, 'report.json') },
57+
[ 'dot' ],
58+
[ 'json', { outputFile: path.join(outputDir, 'report.json') } ],
5959
] : 'line',
6060
projects: [],
6161
};

tests/config/electron.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
3232
forbidOnly: !!process.env.CI,
3333
retries: process.env.CI ? 3 : 0,
3434
reporter: process.env.CI ? [
35-
'dot',
36-
{ name: 'json', outputFile: path.join(outputDir, 'report.json') },
35+
[ 'dot' ],
36+
[ 'json', { outputFile: path.join(outputDir, 'report.json') } ],
3737
] : 'line',
3838
projects: [],
3939
};

0 commit comments

Comments
 (0)