Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix cli handling empty runnerResult during gatherMode #5052

Merged
merged 1 commit into from
Apr 27, 2018

Conversation

paulirish
Copy link
Member

the destructure in saveResults broke cases where gatherMode existed runner early with an undefined runnerResult

plenty of others ways to solve this. happy to do them, though this seemed like the most non-invasive.


driveby fix: avoid comparing output much like gather/auditMode as the output is irrelevant to a gather run.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops sorry! good catch 👍

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

const cwd = process.cwd();
let promise = Promise.resolve();

const shouldSaveResults = flags.auditMode || (flags.gatherMode === flags.auditMode);
if (!shouldSaveResults) return promise;
const {lhr, artifacts} = runnerResult;
Copy link
Member

@brendankenny brendankenny Apr 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearly we need type checking in here :)

@paulirish paulirish merged commit 63c9997 into master Apr 27, 2018
@paulirish paulirish deleted the emptyrunnerresults branch April 27, 2018 18:39
kdzwinel pushed a commit to kdzwinel/lighthouse that referenced this pull request Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants