Skip to content

Commit dc9adec

Browse files
committed
Add tests for createBoundary helper.
1 parent ecf762b commit dc9adec

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/util/createBoundary.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import test from "ava"
2+
3+
import createBoundary from "./createBoundary"
4+
5+
test("Returns a string", t => {
6+
const actual = createBoundary(16)
7+
8+
t.is(typeof actual, "string")
9+
})
10+
11+
test("Returns a string of given length", t => {
12+
const expected = 24
13+
const actual = createBoundary(expected)
14+
15+
t.is(actual.length, expected)
16+
})
17+
18+
test("Returns a string of characters in alphanum range", t => {
19+
const actual = createBoundary(16)
20+
21+
t.regex(actual, /^[a-zA-Z0-9]+$/)
22+
})

0 commit comments

Comments
 (0)