Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
sainthkh committed May 24, 2021
1 parent c4aaa58 commit 46cd1bd
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

0 comments on commit 46cd1bd

Please sign in to comment.