There is a more involved version at https://raw.githubusercontent.com/peer/doc/devel/tests/cypress/support/commands.js
maybe it could help in your case. or not.
In our case, I’m just doing it like:
const myFunc = function(win) {
win.Meteor.call(myMethod, args, function () { /* whatever */ }`
}
describe("some test", () => {
it("some subtest", () => {
cy.server();
cy.route('/sockjs/**', {});
cy.visit('/');
cy.window().then(myFunc);
// ...more code
}
}