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

Commit 30d07ca

Browse files
committed
Add tests.
1 parent 4443b79 commit 30d07ca

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

test/index.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var test = require('tape')
2-
var enc = require('dat-encoding')
32
var datResolve = require('..')
3+
var enc = require('dat-encoding')
44

55
// Strings that do not require lookup
66
var stringKeys = [
@@ -21,27 +21,38 @@ var stringBadKeys = [
2121
test('resolve key with path', function (t) {
2222
t.plan(2)
2323
datResolve('87ed2e3b160f261a032af03921a3bd09227d0a4cde73466c17114816cae43336/path', function (err, newKey) {
24-
console.log('KEYPATH', err, newKey)
2524
t.notOk(err, 'not expected error')
2625
t.ok(newKey, 'is a key')
2726
})
2827
})
2928

30-
/*
29+
test('resolve https hostname with path', function (t) {
30+
t.plan(2)
31+
datResolve('https://beakerbrowser.com/path', function (err, newKey) {
32+
t.notOk(err, 'not expected error')
33+
t.ok(newKey, 'is a key')
34+
})
35+
})
36+
37+
test('resolve dat hostname with path', function (t) {
38+
t.plan(2)
39+
datResolve('dat://beakerbrowser.com/path', function (err, newKey) {
40+
t.notOk(err, 'not expected error')
41+
t.ok(newKey, 'is a key')
42+
})
43+
})
44+
3145
test('resolve hostname with path', function (t) {
3246
t.plan(2)
3347
datResolve('beakerbrowser.com/path', function (err, newKey) {
34-
console.log('HOSTNAMEPATH', err, newKey)
3548
t.notOk(err, 'not expected error')
3649
t.ok(newKey, 'is a key')
3750
})
3851
})
39-
*/
4052

4153
test('resolve key with version', function (t) {
4254
t.plan(2)
4355
datResolve('87ed2e3b160f261a032af03921a3bd09227d0a4cde73466c17114816cae43336+5', function (err, newKey) {
44-
console.log('KEYVERSION', err, newKey)
4556
t.notOk(err, 'not expected error')
4657
t.ok(newKey, 'is a key')
4758
})
@@ -50,7 +61,6 @@ test('resolve key with version', function (t) {
5061
test('resolve hostname with version', function (t) {
5162
t.plan(2)
5263
datResolve('beakerbrowser.com+5', function (err, newKey) {
53-
console.log('HOSTNAMEVERSION', err, newKey)
5464
t.notOk(err, 'not expected error')
5565
t.ok(newKey, 'is a key')
5666
})

0 commit comments

Comments
 (0)