Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorizzo committed Nov 26, 2019
1 parent 30c9493 commit 5c19b2b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/hashes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import keccak from 'keccak'

/**
Expand Down
18 changes: 18 additions & 0 deletions test/hashes.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { keccak256 } from '../src/hashes'
import { assert } from 'chai'

describe('# hashes', function () {
describe(`keccak256`, function () {
let test = [
['', 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'],
['cccc', '9850d829b57b233101525397603baedc32d20288a866514dd5441abe286f4d2e'],
['The quick brown fox jumps over the lazy dog', '4d741b6f1eb29cb2a9b9911c82f56fa8d73b04959d3d9d222895df6c0b28aa15']
]
for (let t of test) {
let [value, expected] = t
it(`should return a keccack256 hash`, () => {
assert.equal(keccak256(value), expected)
})
}
})
})

0 comments on commit 5c19b2b

Please sign in to comment.