Skip to content

Commit

Permalink
test(test/keyPair.js): Simplify keyPair test
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Jul 23, 2018
1 parent b351f0c commit 01b4085
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions test/key-pair.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
const { keyPair } = require('../key-pair')
const isBuffer = require('is-buffer')
const ed25519 = require('../ed25519')
const test = require('ava')

test('keyPair(seed)', async (t) => {
t.throws(() => keyPair(null), TypeError)
t.throws(() => keyPair(0), TypeError)
t.throws(() => keyPair(''), TypeError)
t.throws(() => keyPair(true), TypeError)
t.throws(() => keyPair([]), TypeError)
t.true('object' === typeof keyPair())
t.true('object' === typeof keyPair(Buffer.alloc(32).fill('hello')))
t.true(isBuffer(keyPair().publicKey))
t.true(isBuffer(keyPair().secretKey))
t.true(32 === keyPair().publicKey.length)
t.true(64 === keyPair().secretKey.length)
test('keyPair()', async (t) => {
t.true('function' === typeof keyPair)
t.true(keyPair === ed25519.keyPair)
})

0 comments on commit 01b4085

Please sign in to comment.