Skip to content

Fix incorrectly passed event name for ProjectLoadingFinish event #28266

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

Merged
merged 5 commits into from
Nov 1, 2018

Conversation

sheetalkamat
Copy link
Member

No description provided.

@sheetalkamat sheetalkamat requested review from sandersn, weswigham, a user and rbuckton October 31, 2018 20:39

function getEvents() {
const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/;
return filter(
Copy link

Choose a reason for hiding this comment

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

I usually prefer mapDefined over filter(map(*)), so you don't need a cast at the end and avoid an extra array.

}
}
});

return { session, events };
}

function createSessionWithDefaultEventHandler<T extends protocol.AnyEvent>(host: TestServerHost, eventName: T["event"], opts: Partial<server.SessionOptions> = {}, ...eventNames: T["event"][]) {
Copy link

Choose a reason for hiding this comment

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

If we want the event names to be a rest parameter, we should move eventName to the end and combine it with that. And if we want it to be the second parameter, we could take string | ReadonlyArray<string> there.

@sheetalkamat sheetalkamat merged commit c780186 into master Nov 1, 2018
@sheetalkamat sheetalkamat deleted the fixProjectLoadingFinishEvent branch November 1, 2018 01:14
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.

1 participant