Skip to content

Commit

Permalink
fix: handle BigInt correctly. (#16640)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
  • Loading branch information
sainthkh and chrisbreiding committed May 26, 2021
1 parent ee6d4b9 commit 322b08a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/driver/cypress/integration/commands/assertions_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,20 @@ describe('src/cy/commands/assertions', () => {
})
})

// https://github.com/cypress-io/cypress/issues/16570
it('handles BigInt correctly', (done) => {
cy.on('log:added', (attrs, log) => {
if (attrs.name === 'assert') {
cy.removeAllListeners('log:added')
expect(log.get('message')).to.eq('expected **2n** to equal **2n**')

done()
}
})

expect(2n).to.equal(2n)
})

it('#consoleProps for regular objects', (done) => {
cy.on('log:added', (attrs, log) => {
if (attrs.name === 'assert') {
Expand Down
4 changes: 4 additions & 0 deletions packages/driver/src/cy/chai/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ module.exports = {

case 'symbol':
return ctx.stylize(value.toString(), 'symbol')

case 'bigint':
return ctx.stylize(`${value.toString() }n`, 'bigint')

default:
null
}
Expand Down

4 comments on commit 322b08a

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 322b08a May 26, 2021

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:

npm install https://cdn.cypress.io/beta/npm/7.5.0/circle-develop-322b08a0d526cf3cc6f68cf0fe91e80a7596f6d3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 322b08a May 26, 2021

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 ia32 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:

npm install https://cdn.cypress.io/beta/npm/7.5.0/appveyor-develop-322b08a0d526cf3cc6f68cf0fe91e80a7596f6d3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 322b08a May 26, 2021

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:

npm install https://cdn.cypress.io/beta/npm/7.5.0/appveyor-develop-322b08a0d526cf3cc6f68cf0fe91e80a7596f6d3/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 322b08a May 26, 2021

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:

npm install https://cdn.cypress.io/beta/npm/7.5.0/circle-develop-322b08a0d526cf3cc6f68cf0fe91e80a7596f6d3/cypress.tgz

Please sign in to comment.