@@ -2,8 +2,9 @@ import * as colorette from "colorette"
2
2
import * as diff from "diff"
3
3
4
4
/**
5
- * Checks the two given strings character-by-character for equality.
6
- * If there are any differences, it throws an exception with a Bash-colored diff as the error message.
5
+ * Asserts that two blocks of text are equal, comparing character by character.
6
+ *
7
+ * @throws a bash-colored error if the arguments are not equal
7
8
*/
8
9
export function chars (
9
10
actual : string ,
@@ -23,8 +24,10 @@ export function chars(
23
24
}
24
25
25
26
/**
26
- * Checks the two given Objects for equality.
27
- * If there are any differences, it throws an exception with a Bash-colored diff as the error message.
27
+ * Diffs two JSON objects, comparing the fields defined on each.
28
+ * The order of fields, etc does not matter.
29
+ *
30
+ * @throws a bash-colored error if the arguments are not equal
28
31
*/
29
32
export function json (
30
33
actual : Record < string , unknown > | string [ ] ,
@@ -44,9 +47,9 @@ export function json(
44
47
}
45
48
46
49
/**
47
- * Checks the two given strings line-by- line for equality .
48
- * Extra whitespace is ignored.
49
- * If there are any differences, it throws an exception with a Bash -colored diff as the error message.
50
+ * Diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace .
51
+ *
52
+ * @ throws a bash -colored error if the arguments are not equal
50
53
*/
51
54
export function trimmedLines (
52
55
actual : string ,
@@ -66,8 +69,9 @@ export function trimmedLines(
66
69
}
67
70
68
71
/**
69
- * Checks the two given strings word-by-word for equality treating whitespace as significant.
70
- * If there are any differences, it throws an exception with a Bash-colored diff as the error message.
72
+ * Diffs two blocks of text, comparing word by word, treating whitespace as significant.
73
+ *
74
+ * @throws a bash-colored error if the arguments are not equal
71
75
*/
72
76
export function wordsWithSpace (
73
77
actual : string ,
0 commit comments