Skip to content

Reporter should support all Unicode strings #1039

@revelt

Description

@revelt

Description

Let's make AVA emoji-friendly. Currently it's difficult to use AVA for testing libraries that perform string operations. Here, errors regarding strings containing emoji appear chopped off and often contain broken characters. Consider the most basic example:

Test Source

test.only('foo', t => {
  t.fail('🦄🐴🦄')
})

Error Message & Stack Trace

Notice the broken symbol:

   1 failed


   1. foo
   🦄�
      Test.fn (test.js:508:5)
npm ERR! Test failed.  See above for more details

Since one emoji .length equals to two, second half of second emoji is cut off. That broken symbol is high-surrogate of second emoji.

Config

{
  "ava": {
    "tap": false
  }
}

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and AVA. Run the following to get it quickly:

Node.js v5.11.1
darwin 15.6.0
ava 0.16.0
npm 3.10.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desired

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions