-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ignore replay-connect callback event #297
Ignore replay-connect callback event #297
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some nits, but otherwise good
@@ -54,11 +54,27 @@ let gPluginServer: WebSocket | undefined; | |||
// user-facing | |||
const COMMAND_IGNORE_LIST = ["log-restore", "within-restore", "end-logGroup"]; | |||
|
|||
function handleReplayConnectResponse(v: unknown) { | |||
if (v && typeof v === "object" && "port" in v && typeof v.port === "number") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
purely a nit, but something like this is a bit cleaner for me
if (typeof v?.port !== "number") {
cy.log("[replay.io] Received unexpected response when connecting to plugin");
return;
}
gServerPort = v.port;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is cleaner but it doesn't pass typechecking since v
is unknown so more narrowing is required.
packages/cypress/src/support.ts
Outdated
function shouldIgnoreCommand(cmd: Cypress.EnqueuedCommand | Cypress.CommandQueue) { | ||
if (isCommandQueue(cmd)) { | ||
cmd = cmd.toJSON() as any as Cypress.EnqueuedCommand; | ||
} | ||
|
||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd help to have a comment here
Issue
The plugin is adding
then
commands from ourreplay-connect
callback to thebeforeAll
steps for each test. This wasn't currently visible to users because we aren't showingbeforeAll
andafterAll
yet but it was introducing some confusion in troubleshooting SCS-1642 because there were events in places we didn't expect them to be.Resolution
Suppress our
handleReplayConnectResponse
handler called bythen
from being added to steps and from creating annotations.