我应该使用哪个Cypress链接器来测试别名是使用匹配参数调用的

我应该使用哪个Cypress链接器来测试别名是使用匹配参数调用的,cypress,sinon-chai,Cypress,Sinon Chai,我正在使用Cypress进行E2E测试。我正在使用Sinon.Chai链表be.calledWithMatch测试是否使用匹配参数调用别名: cy.get(“@myAlias”) .should('be.calledWithMatch'{ 参数:“值”, otherParam:“其他值” }); 断言按预期工作,但提供以下非显式错误消息: expected myAlias to have been called with arguments matching Object{2} 我想要的是使

我正在使用Cypress进行E2E测试。我正在使用Sinon.Chai链表
be.calledWithMatch
测试是否使用匹配参数调用别名:

cy.get(“@myAlias”)
.should('be.calledWithMatch'{
参数:“值”,
otherParam:“其他值”
});
断言按预期工作,但提供以下非显式错误消息:

expected myAlias to have been called with arguments matching Object{2}
我想要的是使用链环,使我能够:

  • 使用匹配的参数调用了Test something(就像
    be.calledWithMatch
  • 提供显示预期值的显式断言消息。例如:
我曾想过使用
.wrap()
.find()
.should('eq')
的组合,但这会非常复杂。是否有更合适的链接器来实现我的期望

expected myAlias to have been called with arguments matching { param: 'value', otherParam: 'other value' }