Q:

Cypress: any difference between cy.get("a").find("b") and cy.get("a b")

It seems like they're identical. Is there ever any difference in output between cy.get("a").find("b") and cy.get("a b")?
(Where a and b are some selectors, e.g. div and span, or .someClass and .someOtherClass.)

A:

As you stated in your question there is not difference between cy.get("a").find("b") and cy.get("a b"). But the most important difference between find and get commands in Cypress is that cy.get() is chained off of cy, it always looks for the selector within the entire document as stated in Cypress documents. But as again stated in Cypress documents find works as follows:

Get the descendent DOM elements of a specific selector.

So the command cy.get("a").find("b") returns all the b elements which are successor of an a element, but cy.get("a").get("b") finds all the a and b elements regardless of they are parent and child.

A:

There is no difference in result, but there is a difference in implementation.
From the docs for the .find() command:

The querying behavior of this command matches exactly how .find() works in jQuery.

In other words,
cy.get("a").find("b");

is equivalent to the following JQuery:
$("a").find("b");

$("a").find("b"); will produce the same result as $("a b"), but will use a different method to get there.

I've done a bit of testing to confirm this on a fairly complex page:

Notice how the number results is the same for cy.get("td").find("tr") and cy.get("td tr").

