tests: fix cli handling empty runnerResult during gatherMode (#5052)
This commit is contained in:
Родитель
63b84cfb78
Коммит
63c999789d
|
@ -100,12 +100,12 @@ function handleError(err) {
|
|||
* @return {Promise<void>}
|
||||
*/
|
||||
function saveResults(runnerResult, flags) {
|
||||
const {lhr, artifacts} = runnerResult;
|
||||
const cwd = process.cwd();
|
||||
let promise = Promise.resolve();
|
||||
|
||||
const shouldSaveResults = flags.auditMode || (flags.gatherMode === flags.auditMode);
|
||||
if (!shouldSaveResults) return promise;
|
||||
const {lhr, artifacts} = runnerResult;
|
||||
|
||||
// Use the output path as the prefix for all generated files.
|
||||
// If no output path is set, generate a file prefix using the URL and date.
|
||||
|
|
|
@ -53,6 +53,14 @@ describe('flag coercing', () => {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
describe('saveResults', () => {
|
||||
it('will quit early if we\'re in gather mode', async () => {
|
||||
const result = await run.saveResults(undefined, {gatherMode: true});
|
||||
assert.equal(result, undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Parsing --chrome-flags', () => {
|
||||
it('returns boolean flags that are true as a bare flag', () => {
|
||||
assert.deepStrictEqual(parseChromeFlags('--debug'), ['--debug']);
|
||||
|
|
|
@ -179,7 +179,7 @@ class Runner {
|
|||
artifacts = Object.assign(Runner.instantiateComputedArtifacts(), artifacts);
|
||||
|
||||
if (artifacts.settings) {
|
||||
const overrides = {gatherMode: undefined, auditMode: undefined};
|
||||
const overrides = {gatherMode: undefined, auditMode: undefined, output: undefined};
|
||||
const normalizedGatherSettings = Object.assign({}, artifacts.settings, overrides);
|
||||
const normalizedAuditSettings = Object.assign({}, settings, overrides);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче