Created
February 25, 2018 02:32
-
-
Save sompylasar/95b87cf99644ef64d51e458bb33cfa34 to your computer and use it in GitHub Desktop.
jest-diff-multiline-vs-oneline created by sompylasar - https://repl.it/@sompylasar/jest-diff-multiline-vs-oneline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jestDiff = require('jest-diff'); // should be [email protected] | |
function jestDiffAndPrint(a, b) { | |
console.log( | |
'----------- a:\n' + | |
a + | |
'\n----------- b:\n' + | |
b + | |
'\n----------- diff:\n' + | |
jestDiff(a, b) + | |
'\n-----------\n' | |
); | |
} | |
jestDiffAndPrint('foo\nbar\nbaz', 'foo\n'); | |
jestDiffAndPrint('foo\nbar\nbaz', 'foo'); | |
jestDiffAndPrint('foo', 'foo\n'); | |
jestDiffAndPrint('foo', 'foo\nbar'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment