-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: show call count even if
cy.stub().log(false)
. (#18907)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
- Loading branch information
1 parent
2a6ded2
commit 002fbdd
Showing
3 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
it('test', () => { | ||
const obj = { | ||
foo () {}, | ||
} | ||
const stub = cy.stub(obj, 'foo').log(false).as('foo') | ||
|
||
obj.foo('foo', 'bar') | ||
expect(stub).to.be.called | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const helpers = require('../../support/helpers') | ||
|
||
const { createCypress } = helpers | ||
const { runIsolatedCypress } = createCypress() | ||
|
||
// https://github.com/cypress-io/cypress/issues/18042 | ||
describe('issue 18042', () => { | ||
beforeEach(function () { | ||
return runIsolatedCypress(`cypress/fixtures/issues/issue-18042.js`) | ||
}) | ||
|
||
it('Call count is shown even if cy.stub().log(false)', function () { | ||
cy.contains('Spies / Stubs (1)').click() | ||
cy.get('.call-count').eq(1).should('have.text', '1') | ||
}) | ||
}) |
002fbdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
002fbdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppVeyor has built the
win32 x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
002fbdd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: