Skip to content

expected and actual look the same when unsing some emojis. #127

@jendrikw

Description

@jendrikw

Try this:

import { assert } from 'chai';

assert.strictEqual('️✅', '✅');

Output:

AssertionError: expected '️✅' to equal '✅'
    at _AssertionError (file:///home/projects/stackblitz-starters-o5akycef/node_modules/chai/index.js:182:13)
    at assert (file:///home/projects/stackblitz-starters-o5akycef/node_modules/chai/index.js:1538:13)
    at assertEqual (file:///home/projects/stackblitz-starters-o5akycef/node_modules/chai/index.js:2276:10)
    at <anonymous> (file:///home/projects/stackblitz-starters-o5akycef/node_modules/chai/index.js:1722:25)
    at assert.strictEqual (file:///home/projects/stackblitz-starters-o5akycef/node_modules/chai/index.js:3439:56)
    at  (file:///home/projects/stackblitz-starters-o5akycef/index.js:14:14)
    at _0x49baf9 (https://stackblitzstarterso5akycef-o1x1.w-corp-staticblitz.com/blitz.cf284e50.js:31:819814)
    at run (https://stackblitzstarterso5akycef-o1x1.w-corp-staticblitz.com/blitz.cf284e50.js:31:820546)
    at _0x39c6d6 (https://stackblitzstarterso5akycef-o1x1.w-corp-staticblitz.com/blitz.cf284e50.js:31:835720)
    at _evaluate (https://stackblitzstarterso5akycef-o1x1.w-corp-staticblitz.com/blitz.cf284e50.js:31:836069)
    at evaluate (https://stackblitzstarterso5akycef-o1x1.w-corp-staticblitz.com/blitz.cf284e50.js:31:832499)
    at run (node:internal/modules/esm/module_job:158:3371) {
  actual: '️✅',
  expected: '✅',
  showDiff: true,
  operator: 'strictEqual'
}

I don't know how I'm supposed to fix the issue. Is there an option to print the code points of each string?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions