Skip to content

Commit

Permalink
test: roll to folio@0.4.0-alpha27 (#6897)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Jun 4, 2021
1 parent 85786b1 commit 21b00d0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
25 changes: 14 additions & 11 deletions docs/src/test-reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ You can use different reporters locally and on CI.
// playwright.config.js
module.exports = {
reporter: !process.env.CI
// A list of tests for the terminal
// Default 'list' reporter for the terminal
? 'list'
// Very concise "dot" reporter and a comprehensive json report for CI
: ['dot', { name: 'json', outputFile: 'test-results.json' }],
// Two reporters for CI:
// - concise "dot"
// - comprehensive json report
: [ ['dot'], [ 'json', { outputFile: 'test-results.json' }] ],
};
```

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

const config: PlaywrightTestConfig = {
reporter: !process.env.CI
// A list of tests for the terminal
// Default 'list' reporter for the terminal
? 'list'
// Very concise "dot" reporter and a comprehensive json report for CI
: ['dot', { name: 'json', outputFile: 'test-results.json' }],
// Two reporters for CI:
// - concise "dot"
// - comprehensive json report
: [ ['dot'], [ 'json', { outputFile: 'test-results.json' }] ],
};
export default config;
```
Expand Down Expand Up @@ -190,7 +193,7 @@ In configuration file, pass options directly:
```js js-flavor=js
// playwright.config.js
module.exports = {
reporter: { name: 'json', outputFile: 'results.json' },
reporter: [ ['json', { outputFile: 'results.json' }] ],
};
```

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

const config: PlaywrightTestConfig = {
reporter: { name: 'json', outputFile: 'results.json' },
reporter: [ ['json', { outputFile: 'results.json' }] ],
};
export default config;
```
Expand All @@ -217,7 +220,7 @@ In configuration file, pass options directly:
```js js-flavor=js
// playwright.config.js
module.exports = {
reporter: { name: 'junit', outputFile: 'results.xml' },
reporter: [ ['junit', { outputFile: 'results.xml' }] ],
};
```

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

const config: PlaywrightTestConfig = {
reporter: { name: 'junit', outputFile: 'results.xml' },
reporter: [ ['junit', { outputFile: 'results.xml' }] ],
};
export default config;
```
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.1.0",
"folio": "=0.4.0-alpha26",
"folio": "=0.4.0-alpha27",
"formidable": "^1.2.2",
"html-webpack-plugin": "^4.4.1",
"ncp": "^2.0.0",
Expand Down
6 changes: 2 additions & 4 deletions src/cli/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const tsConfig = 'playwright.config.ts';
const jsConfig = 'playwright.config.js';
const defaultConfig: Config = {
preserveOutput: process.env.CI ? 'failures-only' : 'always',
reporter: [defaultReporter],
reporter: [ [defaultReporter] ],
timeout: defaultTimeout,
updateSnapshots: process.env.CI ? 'none' : 'missing',
workers: Math.ceil(require('os').cpus().length / 2),
Expand Down Expand Up @@ -167,9 +167,7 @@ function overridesFromOptions(options: { [key: string]: any }): Config {
quiet: options.quiet ? options.quiet : undefined,
repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : undefined,
retries: options.retries ? parseInt(options.retries, 10) : undefined,
reporter: (options.reporter && options.reporter.length) ? options.reporter.split(',').map((r: string) => {
return builtinReporters.includes(r) ? r : { require: r };
}) : undefined,
reporter: (options.reporter && options.reporter.length) ? options.reporter.split(',').map((r: string) => [r]) : undefined,
shard: shardPair ? { current: shardPair[0] - 1, total: shardPair[1] } : undefined,
timeout: isDebuggerAttached ? 0 : (options.timeout ? parseInt(options.timeout, 10) : undefined),
updateSnapshots: options.updateSnapshots ? 'all' as const : undefined,
Expand Down
4 changes: 2 additions & 2 deletions tests/config/android.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
reporter: process.env.CI ? [
'dot',
{ name: 'json', outputFile: path.join(outputDir, 'report.json') },
[ 'dot' ],
[ 'json', { outputFile: path.join(outputDir, 'report.json') } ],
] : 'line',
projects: [],
};
Expand Down
4 changes: 2 additions & 2 deletions tests/config/default.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 3 : 0,
reporter: process.env.CI ? [
'dot',
{ name: 'json', outputFile: path.join(outputDir, 'report.json') },
[ 'dot' ],
[ 'json', { outputFile: path.join(outputDir, 'report.json') } ],
] : 'line',
projects: [],
};
Expand Down
4 changes: 2 additions & 2 deletions tests/config/electron.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const config: folio.Config<CommonOptions & PlaywrightOptions> = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 3 : 0,
reporter: process.env.CI ? [
'dot',
{ name: 'json', outputFile: path.join(outputDir, 'report.json') },
[ 'dot' ],
[ 'json', { outputFile: path.join(outputDir, 'report.json') } ],
] : 'line',
projects: [],
};
Expand Down

0 comments on commit 21b00d0

Please sign in to comment.