add node_modules

This commit is contained in:
fxy060608
2018-11-18 15:15:00 +08:00
parent 2ca7c14dbc
commit 5ceb08127a
1366 changed files with 120305 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
var tape = require('tape')
var toBuffer = require('./')
tape('buffer returns buffer', function (t) {
t.same(toBuffer(Buffer('hi')), Buffer('hi'))
t.end()
})
tape('string returns buffer', function (t) {
t.same(toBuffer('hi'), Buffer('hi'))
t.end()
})
tape('string + enc returns buffer', function (t) {
t.same(toBuffer('6869', 'hex'), Buffer('hi'))
t.end()
})
tape('other input throws', function (t) {
try {
toBuffer(42)
} catch (err) {
t.same(err.message, 'Input should be a buffer or a string')
t.end()
}
})