How do I assert against objects with spies in Cypress?
问题 I am using Cypress spies to test client-side analytics. My intent in this test is to confirm that identify has been called like so: identify('myemail@email.com', { groupId: 1002, groupName: "myGroup", someProp: 1, anotherProp: 2 }) I hook the spies into emitter events on a global analytics object in window:before:load (note the while loop is to deal with delays in the library loading): Cypress.on("window:before:load", async (win: Window) => { const sleep = (n = 1) => new Promise(r =>