From d17474b7ed2d5186cf9ca33e591aebff488d58ce Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Mon, 22 Apr 2019 11:40:15 -0700 Subject: [PATCH] cli: document that CSV is output to file --- lighthouse-cli/cli-flags.js | 2 +- lighthouse-cli/test/cli/bin-test.js | 7 +++++++ readme.md | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lighthouse-cli/cli-flags.js b/lighthouse-cli/cli-flags.js index 61bcdccfcc6f..58c1939a650a 100644 --- a/lighthouse-cli/cli-flags.js +++ b/lighthouse-cli/cli-flags.js @@ -114,7 +114,7 @@ function getFlags(manualArgv) { 'output': `Reporter for the results, supports multiple values`, 'output-path': `The file path to output the results. Use 'stdout' to write to stdout. If using JSON output, default is stdout. - If using HTML output, default is a file in the working directory with a name based on the test URL and date. + If using HTML or CSV output, default is a file in the working directory with a name based on the test URL and date. If using multiple outputs, --output-path is appended with the standard extension for each output type. "reports/my-run" -> "reports/my-run.report.html", "reports/my-run.report.json", etc. Example: --output-path=./lighthouse-results.html`, 'view': 'Open HTML report in your browser', diff --git a/lighthouse-cli/test/cli/bin-test.js b/lighthouse-cli/test/cli/bin-test.js index 70ef3e9544dd..713d0172c318 100644 --- a/lighthouse-cli/test/cli/bin-test.js +++ b/lighthouse-cli/test/cli/bin-test.js @@ -131,6 +131,13 @@ describe('CLI bin', function() { expect(getRunLighthouseArgs()[1]).toHaveProperty('outputPath', 'stdout'); }); + + it('should have no default path when using csv', async () => { + cliFlags = {...cliFlags, output: ['csv']}; + await bin.begin(); + + expect(getRunLighthouseArgs()[1]).toHaveProperty('outputPath', ''); + }); }); describe('extraHeaders', () => { diff --git a/readme.md b/readme.md index 97ff20c14e29..6a8dae4dad83 100644 --- a/readme.md +++ b/readme.md @@ -78,10 +78,10 @@ Configuration: --audit-mode, -A Process saved artifacts from disk [boolean] Output: - --output Reporter for the results, supports multiple values [choices: "csv", "json", "html"] [default: "html"] + --output Reporter for the results, supports multiple values [choices: "json", "html", "csv"] [default: "html"] --output-path The file path to output the results. Use 'stdout' to write to stdout. - If using JSON or CSV output, default is stdout. - If using HTML output, default is a file in the working directory with a name based on the test URL and date. + If using JSON output, default is stdout. + If using HTML or CSV output, default is a file in the working directory with a name based on the test URL and date. If using multiple outputs, --output-path is appended with the standard extension for each output type. "reports/my-run" -> "reports/my-run.report.html", "reports/my-run.report.json", etc. Example: --output-path=./lighthouse-results.html --view Open HTML report in your browser [boolean]