File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,19 @@ verifying the equality of larger strings or data structures in tests.
16
16
``` javascript
17
17
import * as assertNoDiff from " assert-no-diff"
18
18
19
- // assert no differences between two JavaScript objects
19
+ // Diffs two JSON objects, comparing the fields defined on each.
20
+ // The order of fields does not matter.
20
21
assertNoDiff .json (actualJson, expectedJson)
21
22
22
- // compare strings and highlight the differences character-by- character
23
+ // Asserts that two blocks of text are equal, comparing character by character.
23
24
assertNoDiff .chars (actualString, expectedString)
24
25
25
- // compare strings and highlight the mismatching words, whitespace-sensitive
26
+ // Diffs two blocks of text, comparing word by word.
27
+ // Whitespace is significant.
26
28
assertNoDiff .wordsWithSpace (actualString, expectedString)
27
29
28
- // compare strings and highlight the mismatching lines, ignoring whitespace around them
30
+ // Diffs two blocks of text, comparing line by line.
31
+ // Ignores leading and trailing whitespace.
29
32
assertNoDiff .trimmedLines (actualString, expectedString)
30
33
```
31
34
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export function chars(
25
25
26
26
/**
27
27
* Diffs two JSON objects, comparing the fields defined on each.
28
- * The order of fields, etc does not matter.
28
+ * The order of fields does not matter.
29
29
*
30
30
* @throws a bash-colored error if the arguments are not equal
31
31
*/
@@ -47,7 +47,8 @@ export function json(
47
47
}
48
48
49
49
/**
50
- * Diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace.
50
+ * Diffs two blocks of text, comparing line by line.
51
+ * Ignores leading and trailing whitespace.
51
52
*
52
53
* @throws a bash-colored error if the arguments are not equal
53
54
*/
@@ -69,7 +70,8 @@ export function trimmedLines(
69
70
}
70
71
71
72
/**
72
- * Diffs two blocks of text, comparing word by word, treating whitespace as significant.
73
+ * Diffs two blocks of text, comparing word by word.
74
+ * Whitespace is significant.
73
75
*
74
76
* @throws a bash-colored error if the arguments are not equal
75
77
*/
You can’t perform that action at this time.
0 commit comments