Skip to content

Commit fb8e22c

Browse files
committed
trimmed-lines.test.ts
1 parent bf53ad0 commit fb8e22c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/trimmed-lines.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import chalk from "chalk"
1+
import { gray, green, red } from "colorette"
22
import assert from "node:assert/strict"
33
import { suite, test } from "node:test"
44
import stripAnsi from "strip-ansi"
55
import * as assertNoDiff from "../src/index"
66

7-
suite("assertNoDiff.trimmedLines", function() {
8-
test("matching data", function() {
7+
suite("assertNoDiff.trimmedLines", function () {
8+
test("matching data", function () {
99
const data = "Jean-Luc Picard"
1010
assertNoDiff.trimmedLines(data, data)
1111
})
1212

13-
test("matching data with surrounding whitespace", function() {
13+
test("matching data with surrounding whitespace", function () {
1414
const obj1 = "foo"
1515
const obj2 = " foo "
1616
assertNoDiff.trimmedLines(
@@ -20,33 +20,33 @@ suite("assertNoDiff.trimmedLines", function() {
2020
)
2121
})
2222

23-
test("mismatching data", function() {
23+
test("mismatching data", function () {
2424
const obj1 = "Jean-Luc\nPicard"
2525
const obj2 = "Captain\nPicard"
2626

27-
const expected = chalk`mismatching lines:
27+
const expected = `mismatching lines:
2828
29-
{red Jean-Luc\n}{green Captain\n}{grey Picard}`
30-
assert.throws(function() {
29+
${red("Jean-Luc\n")}${green("Captain\n")}${gray("Picard")}`
30+
assert.throws(function () {
3131
assertNoDiff.trimmedLines(obj2, obj1)
3232
}, new Error(expected))
3333
})
3434

35-
test("no expected value", function() {
36-
assert.throws(function() {
35+
test("no expected value", function () {
36+
assert.throws(function () {
3737
// @ts-ignore
3838
assertNoDiff.trimmedLines("foo")
3939
}, new Error("AssertNoDiff: expected value not provided"))
4040
})
4141

42-
test("no actual value", function() {
43-
assert.throws(function() {
42+
test("no actual value", function () {
43+
assert.throws(function () {
4444
// @ts-ignore
4545
assertNoDiff.trimmedLines()
4646
}, new Error("AssertNoDiff: actual value not provided"))
4747
})
4848

49-
test("custom error message", function() {
49+
test("custom error message", function () {
5050
try {
5151
assertNoDiff.trimmedLines("one", "two", "custom message")
5252
} catch (e) {
@@ -57,7 +57,7 @@ suite("assertNoDiff.trimmedLines", function() {
5757
throw new Error("assertNoDiff.trimmedLines didn't throw")
5858
})
5959

60-
test("diffing empty strings", function() {
60+
test("diffing empty strings", function () {
6161
assertNoDiff.trimmedLines("", "", "should allow diffing empty strings")
6262
})
6363
})

0 commit comments

Comments
 (0)