You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, mocking with cy.stub (via sinon) does not mock an exported named function (and perhaps value) from an imported module.
Users coming from other testing libraries (like Jest), are accustomed to being able to mock out these dependencies for their tests. Ideally, we should be able to support mocking to the same level as Jest.
Acceptance Criteria
Mocking a named export should work
The API should be intuitive (much like cy.stub or jest.fn now).
┆Issue is synchronized with this Jira Task by Unito
┆author: Ely Lucas
┆epic: CT Post Unification Release
┆friendlyId: UNIFY-610
┆priority: Low
┆sprint: Backlog
┆taskType: Task
The text was updated successfully, but these errors were encountered:
This seems related to a recently opened issue #22355. Adding the link here for cross-reference. Some additional evaluation may show that we could close one out if there is complete overlap. This came over from our Jira issues with a 'Low' priority, but it seems that we may want to bump that up and consider reprioritizing. Both Jess and Lachlan have raised this issue up internally. Tagging @baus for visibility for when he's back next week.
Summary
Currently, mocking with cy.stub (via sinon) does not mock an exported named function (and perhaps value) from an imported module.
Users coming from other testing libraries (like Jest), are accustomed to being able to mock out these dependencies for their tests. Ideally, we should be able to support mocking to the same level as Jest.
Acceptance Criteria
Mocking a named export should work
The API should be intuitive (much like cy.stub or jest.fn now).
Resources
See this thread on slack: https://cypressio.slack.com/archives/C011BAPC614/p1637104236309500
Sample repo demonstrating the issue: https://github.com/elylucas/cypress-stub-function-issue
Open Pull Requests
┆Issue is synchronized with this Jira Task by Unito
┆author: Ely Lucas
┆epic: CT Post Unification Release
┆friendlyId: UNIFY-610
┆priority: Low
┆sprint: Backlog
┆taskType: Task
The text was updated successfully, but these errors were encountered: