git ssb

0+

wanderer🌟 / bls-lib



Commit d19c0b884a7ce9b2ff7b79a37e82e31d95dd703f

added converage

Signed-off-by: wanderer <mjbecze@gmail.com>
wanderer committed on 10/3/2017, 6:13:57 PM
Parent: b9416597a87c7031440d7a19bd261cda212548cb

Files changed

index.jschanged
package.jsonchanged
tests/index.jschanged
index.jsView
@@ -3,9 +3,9 @@
33
44 exports.mod = mod
55
66 let init = false
7-let initCb = () => {}
7 +let initCb
88
99 /**
1010 * takes a callback that is called once the module is setup
1111 * @params {Function} cb - the callback tobe called once the module is intailized
package.jsonView
@@ -39,6 +39,11 @@
3939 "/build/",
4040 "pre.js",
4141 "/bls/"
4242 ]
43 + },
44 + "nyc": {
45 + "exclude": [
46 + "build"
47 + ]
4348 }
4449 }
tests/index.jsView
@@ -204,5 +204,24 @@
204204 }
205205
206206 t.end()
207207 })
208 +
209 + tape('int ids', t => {
210 + bls.init()
211 + t.plan(2)
212 + const sec = bls.secretKey()
213 + bls.idSetInt(sec, 7)
214 +
215 + const secKey = bls.secretKeySerialize(sec)
216 + const expected = new Uint8Array(32)
217 + expected[0] = 7
218 + t.deepEqual(secKey, expected)
219 +
220 + try {
221 + bls.idSetInt(sec, 0)
222 + } catch (e) {
223 + t.pass('shouldnt accept 0 as an id')
224 + }
225 + t.end()
226 + })
208227 })

Built with git-ssb-web