Skip to content

Commit

Permalink
tests: switch to for(it( style
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Jun 26, 2014
1 parent 3a621ae commit 950cda4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
34 changes: 34 additions & 0 deletions test/bs58.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var assert = require('assert')
var base58 = require('../lib/bs58')

var fixtures = require('./fixtures.json')

describe('base58', function() {
describe('encode', function() {
fixtures.valid.forEach(function(f) {
it('can encode ' + f.hex, function() {
var actual = base58.encode(new Buffer(f.hex, 'hex'))

assert.strictEqual(actual, f.string)
})
})
})

describe('decode', function() {
fixtures.valid.forEach(function(f) {
it('can decode ' + f.string, function() {
var actual = base58.decode(f.string).toString('hex')

assert.strictEqual(actual, f.hex)
})
})

fixtures.invalid.forEach(function(f) {
it('throws on ' + f.description, function() {
assert.throws(function() {
base58.decode(f.string)
}, /invalid base58 string/)
})
})
})
})
32 changes: 0 additions & 32 deletions test/bs58.test.js

This file was deleted.

0 comments on commit 950cda4

Please sign in to comment.