Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.

Commit 2830aa0

Browse files
committed
Test bad long and short keys.
1 parent 5c9fec3 commit 2830aa0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ var stringKeys = [
1313
{type: 'valid', key: 'host.com/whatever/6161616161616161616161616161616161616161616161616161616161616161'}
1414
]
1515

16+
var stringBadKeys = [
17+
{type: 'invalid', key: '616161616161616161616161616161616161616161616161616161616161616'},
18+
{type: 'invalid', key: '61616161616161616161616161616161616161616161616161616161616161612'}
19+
]
20+
21+
test('resolve bad key without http', function (t) {
22+
t.plan(2 * stringBadKeys.length) // 2 tests for 2 keys
23+
stringBadKeys.forEach(function (key) {
24+
datResolve(key.key, function (err, newKey) {
25+
t.ok(err, 'expected error')
26+
t.notOk(newKey, 'not a key')
27+
})
28+
})
29+
})
30+
1631
test('resolve key without http', function (t) {
1732
t.plan(3 * 7) // 3 tests for 7 keys
1833
stringKeys.forEach(function (key) {

0 commit comments

Comments
 (0)