Misleading argument description in .should('have.been.calledWith', ['arg1, 'arg2'])
t-benze opened this issue · comments
Benze Tang commented
Subject
guides/references/assertions
Description
https://docs.cypress.io/guides/references/assertions#Sinon-Chai
The current document states that the arguments should be passed in as an array, while the actual behavior expects a list of arguments.
For example, the following assertion will fail when running the test.
//wrong assertion with array
cy.get('@open').should('have.been.calledOnceWithExactly', [
`${Cypress.config('baseUrl')}/?space=e7bf21ca`,
`inkstain-e7bf21ca`,
]);
Changing to argument list will pass.
cy.get('@open').should(
'have.been.calledOnceWithExactly',
`${Cypress.config('baseUrl')}/?space=e7bf21ca`,
`inkstain-e7bf21ca`
);
Jennifer Shehane commented
@t-benze We're open to a pull request to clarify this.
Benze Tang commented
hi @jennifer-shehane i've created a pull request regarding this issue, thanks.