Skip to content

Commit 2bedd9e

Browse files
committed
words-with-space.test.ts
1 parent c50153f commit 2bedd9e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/words-with-space.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,53 @@ import { suite, test } from "node:test"
44
import stripAnsi from "strip-ansi"
55
import * as assertNoDiff from "../src/index"
66

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

13-
test("mismatching data", function () {
13+
test("mismatching data", function() {
1414
const obj1 = "Jean-Luc Picard"
1515
const obj2 = "Captain Picard"
1616
const expected = `mismatching words:
1717
1818
${red("Jean-Luc")}${green("Captain")}${gray(" Picard")}`
19-
assert.throws(function () {
19+
assert.throws(function() {
2020
assertNoDiff.wordsWithSpace(obj2, obj1)
2121
}, new Error(expected))
2222
})
2323

24-
test("extra whitespace", function () {
24+
test("extra whitespace", function() {
2525
const obj1 = "foo bar"
2626
const obj2 = " foo bar"
2727
const expected = `mismatching words:
2828
2929
${green(" ")}${gray("foo bar")}`
3030
assert.throws(
31-
function () {
31+
function() {
3232
assertNoDiff.wordsWithSpace(obj2, obj1)
3333
},
3434
new Error(expected),
3535
"should not tolerate surrounding whitespace"
3636
)
3737
})
3838

39-
test("no expected value", function () {
40-
assert.throws(function () {
39+
test("no expected value", function() {
40+
assert.throws(function() {
4141
// @ts-ignore
4242
assertNoDiff.wordsWithSpace("foo")
4343
}, new Error("AssertNoDiff: expected value not provided"))
4444
})
4545

46-
test("no actual value", function () {
47-
assert.throws(function () {
46+
test("no actual value", function() {
47+
assert.throws(function() {
4848
// @ts-ignore
4949
assertNoDiff.wordsWithSpace()
5050
}, new Error("AssertNoDiff: actual value not provided"))
5151
})
5252

53-
test("custom error message", function () {
53+
test("custom error message", function() {
5454
try {
5555
assertNoDiff.wordsWithSpace("one", "two", "custom message")
5656
} catch (e) {
@@ -61,7 +61,7 @@ ${green(" ")}${gray("foo bar")}`
6161
throw new Error("assertNoDiff.wordsWithSpace didn't throw")
6262
})
6363

64-
test("empty strings", function () {
64+
test("empty strings", function() {
6565
assertNoDiff.wordsWithSpace("", "", "should allow diffing empty strings")
6666
})
6767
})

0 commit comments

Comments
 (0)