diff --git a/packages/pretty-format/src/index.js b/packages/pretty-format/src/index.js index af3f32be8011..b0c2c4b0d078 100644 --- a/packages/pretty-format/src/index.js +++ b/packages/pretty-format/src/index.js @@ -106,7 +106,8 @@ function printBasicValue( return printNumber(val); } if (typeOf === 'string') { - return /\r\n|\n|\r/g.test(val) + console.log(/\r\n?|\n/gm.test(val), val); // debug windows + return /\r\n?|\n/gm.test(val) ? '`' + val.replace(/\\/g, '\\$&') + '`' : '"' + val.replace(/"|\\/g, '\\$&') + '"'; }