You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
405 B
19 lines
405 B
4 years ago
|
var test = require('tape')
|
||
|
var Codec = require('..')
|
||
|
|
||
|
test('codec', function (t) {
|
||
|
var codec = new Codec({ keyEncoding: 'hex' })
|
||
|
t.ok(codec.keyAsBuffer())
|
||
|
codec = new Codec()
|
||
|
t.notOk(codec.keyAsBuffer())
|
||
|
t.end()
|
||
|
})
|
||
|
|
||
|
test('codec, new not needed', function (t) {
|
||
|
var codec = Codec({ keyEncoding: 'hex' })
|
||
|
t.ok(codec.keyAsBuffer())
|
||
|
codec = Codec()
|
||
|
t.notOk(codec.keyAsBuffer())
|
||
|
t.end()
|
||
|
})
|