jest-diff
Advanced tools
Comparing version 21.0.0-alpha.2 to 21.0.0-beta.1
@@ -74,8 +74,7 @@ 'use strict'; | ||
const mark = color(part.added ? '+' : part.removed ? '-' : ' '); | ||
return mark + ' ' + color(highlightedLine) + '\n'; | ||
return mark + ' ' + color(highlightedLine); | ||
}). | ||
join(''); | ||
join('\n'); | ||
}). | ||
join(''). | ||
trim(), | ||
join('\n'), | ||
isDifferent }; | ||
@@ -129,5 +128,5 @@ | ||
const highlightedLine = highlightTrailingWhitespace(line, bgColor); | ||
return color(highlightedLine) + '\n'; | ||
return color(highlightedLine); | ||
}). | ||
join(''); | ||
join('\n'); | ||
@@ -139,4 +138,3 @@ isDifferent = true; | ||
}). | ||
join(''). | ||
trim(), | ||
join('\n'), | ||
isDifferent }; | ||
@@ -143,0 +141,0 @@ |
@@ -43,2 +43,4 @@ 'use strict'; | ||
const MULTILINE_REGEXP = /[\r\n]/; | ||
// Generate a string that will highlight the difference between two values | ||
@@ -83,5 +85,5 @@ // with green and red. (similar to how github does code diffing) | ||
case 'string': | ||
const multiline = a.match(/[\r\n]/) !== -1 && b.indexOf('\n') !== -1; | ||
const multiline = MULTILINE_REGEXP.test(a) && b.indexOf('\n') !== -1; | ||
if (multiline) { | ||
return (0, _diff_strings2.default)(String(a), String(b), options); | ||
return (0, _diff_strings2.default)(a, b, options); | ||
} | ||
@@ -88,0 +90,0 @@ return null; |
{ | ||
"name": "jest-diff", | ||
"version": "21.0.0-alpha.2", | ||
"version": "21.0.0-beta.1", | ||
"repository": { | ||
@@ -13,6 +13,5 @@ "type": "git", | ||
"diff": "^3.2.0", | ||
"jest-get-type": "21.0.0-alpha.2", | ||
"jest-matcher-utils": "21.0.0-alpha.2", | ||
"pretty-format": "21.0.0-alpha.2" | ||
"jest-get-type": "21.0.0-beta.1", | ||
"pretty-format": "21.0.0-beta.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
11369
231
+ Addedjest-get-type@21.0.0-beta.1(transitive)
+ Addedpretty-format@21.0.0-beta.1(transitive)
- Removedjest-matcher-utils@21.0.0-alpha.2
- Removedjest-get-type@21.0.0-alpha.2(transitive)
- Removedjest-matcher-utils@21.0.0-alpha.2(transitive)
- Removedpretty-format@21.0.0-alpha.2(transitive)
Updatedjest-get-type@21.0.0-beta.1
Updatedpretty-format@21.0.0-beta.1