diff --git a/packages/driver/cypress/integration/commands/assertions_spec.js b/packages/driver/cypress/integration/commands/assertions_spec.js index 4dc7978421ff..96e960b6a0ba 100644 --- a/packages/driver/cypress/integration/commands/assertions_spec.js +++ b/packages/driver/cypress/integration/commands/assertions_spec.js @@ -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') { diff --git a/packages/driver/src/cy/chai/inspect.js b/packages/driver/src/cy/chai/inspect.js index 73fbf0aff76f..1e9147d7f112 100644 --- a/packages/driver/src/cy/chai/inspect.js +++ b/packages/driver/src/cy/chai/inspect.js @@ -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 }