/* @flow */
const jsdiff = require('diff');
require('colors');

export default function logDiff(label: string, a: string, b: string) {
  const { write } = process.stdout;
  const diff = jsdiff.diffChars(a, b);
  // $FlowFixMe
  write(`${label['yellow']}\n`);
  diff.forEach(({ added, removed, value }) => {
    const color = added ? 'green' : removed ? 'red' : 'grey';
    write(value[color]);
  });
  write('\n\n');
}

@@ -96,22 +96,19 @@
 (label: 
-string
+any
 , a: str
@@ -129,44 +129,8 @@
 ) %7B%0A
-  const %7B write %7D = process.stdout;%0A
   co
@@ -170,24 +170,23 @@
 ;%0A  
-// $FlowFixMe%0A  
+process.stdout.
 writ
@@ -326,16 +326,31 @@
 y';%0A    
+process.stdout.
 write(va
@@ -370,16 +370,31 @@
   %7D);%0A  
+process.stdout.
 write('%5C

Fix console warning when running tests