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.js | changed |
package.json | changed |
tests/index.js | changed |
index.js | ||
---|---|---|
@@ -3,9 +3,9 @@ | ||
3 | 3 … | |
4 | 4 … | exports.mod = mod |
5 | 5 … | |
6 | 6 … | let init = false |
7 | -let initCb = () => {} | |
7 … | +let initCb | |
8 | 8 … | |
9 | 9 … | /** |
10 | 10 … | * takes a callback that is called once the module is setup |
11 | 11 … | * @params {Function} cb - the callback tobe called once the module is intailized |
package.json | ||
---|---|---|
@@ -39,6 +39,11 @@ | ||
39 | 39 … | "/build/", |
40 | 40 … | "pre.js", |
41 | 41 … | "/bls/" |
42 | 42 … | ] |
43 … | + }, | |
44 … | + "nyc": { | |
45 … | + "exclude": [ | |
46 … | + "build" | |
47 … | + ] | |
43 | 48 … | } |
44 | 49 … | } |
tests/index.js | ||
---|---|---|
@@ -204,5 +204,24 @@ | ||
204 | 204 … | } |
205 | 205 … | |
206 | 206 … | t.end() |
207 | 207 … | }) |
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 … | + }) | |
208 | 227 … | }) |
Built with git-ssb-web