json-diff icon indicating copy to clipboard operation
json-diff copied to clipboard

Doesn't work on Windows

Open altano opened this issue 12 years ago • 2 comments

The colorization is completely broken, despite the dependent console colorization library, cli-color, claiming to support Windows. Here's what my output looks like:

Starting Feeds
----
Testing: RSS (2.0)
Testing: Atom (1.0)
Testing: RDF test

C:\Users\altano\Documents\Projects\htmlparser2\node_modules\assert-diff\lib\assert-diff.js:23
    throw e
          ^
AssertionError: didn't get expected output←[m
 [
   ...
   ...
   {
     data: [
←[31m-      "html"←[39m
←[31m-      {←[39m
←[31m-      }←[39m
←[32m+      "body"←[39m
←[32m+      {←[39m
←[32m+      }←[39m
     ]
   }
   ...

A brief look at colorize.js leads me to believe you aren't actually using cli-color except to get the color code. I tested the library and it works fine on Windows. Can you use the helper functions built into it to actually generate the colorized strings to be used?

altano avatar Aug 01 '13 03:08 altano

Hey! I'd appreciate a pull request fixing this issue, shouldn't be hard to do. It might take a while for me to get to fixing this personally.

andreyvit avatar Aug 01 '13 08:08 andreyvit

If anyone is gonna PR it, I suggest using chalk instead of cli-color.

mk-pmb avatar Oct 07 '16 20:10 mk-pmb