Tests to arrow functions, use strict asserts, travis uses docker instead of regtest server
This commit is contained in:
parent
16823e9013
commit
dc1ef5958b
24 changed files with 505 additions and 498 deletions
test
|
@ -4,14 +4,14 @@ const bcrypto = require('../src/crypto')
|
|||
|
||||
const fixtures = require('./fixtures/crypto')
|
||||
|
||||
describe('crypto', function () {
|
||||
['hash160', 'hash256', 'ripemd160', 'sha1', 'sha256'].forEach(function (algorithm) {
|
||||
describe(algorithm, function () {
|
||||
fixtures.forEach(function (f) {
|
||||
describe('crypto', () => {
|
||||
['hash160', 'hash256', 'ripemd160', 'sha1', 'sha256'].forEach(algorithm => {
|
||||
describe(algorithm, () => {
|
||||
fixtures.forEach(f => {
|
||||
const fn = bcrypto[algorithm]
|
||||
const expected = f[algorithm]
|
||||
|
||||
it('returns ' + expected + ' for ' + f.hex, function () {
|
||||
it('returns ' + expected + ' for ' + f.hex, () => {
|
||||
const data = Buffer.from(f.hex, 'hex')
|
||||
const actual = fn(data).toString('hex')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue