Tests to arrow functions, use strict asserts, travis uses docker instead of regtest server

This commit is contained in:
junderw 2019-04-09 15:09:50 +09:00
parent 16823e9013
commit dc1ef5958b
No known key found for this signature in database
GPG key ID: B256185D3A971908
24 changed files with 505 additions and 498 deletions

View file

@ -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')