andreyvit / json-diff

Structural diff for JSON files
MIT License
1.13k stars 134 forks source link

Doesn't work on Windows #6

Open altano opened 11 years ago

altano commented 11 years ago

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?

andreyvit commented 11 years ago

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.

mk-pmb commented 8 years ago

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