Commit d525d85855e0a0c8fe377418f26139e6d014b09b
test counts
Dominic Tarr committed on 7/27/2017, 8:37:37 AMParent: 51bc8f6b41ef93f18917bc07054c74c30412ad28
Files changed
test/generate.js | changed |
test/generate.js | |||
---|---|---|---|
@@ -34,8 +34,11 @@ | |||
34 | 34 … | ||
35 | 35 … | t.equal(state.feeds[keys.id].id, v.id(msg)) | |
36 | 36 … | t.equal(state.queue.length, 1) | |
37 | 37 … | ||
38 … | + t.equal(state.validated, 1) | ||
39 … | + t.equal(state.queued, 0) | ||
40 … | + | ||
38 | 41 … | //queue appends to a feed, but does not write check the signature | |
39 | 42 … | //(because that is quite slow on javascript crypto) | |
40 | 43 … | ||
41 | 44 … | var msg2 = v.create(keys, null, fstate, {type: 'test2'}, +new Date('2017-04-11 8:09 UTC')) | |
@@ -62,24 +65,31 @@ | |||
62 | 65 … | ||
63 | 66 … | ||
64 | 67 … | tape('queue the first item', function (t) { | |
65 | 68 … | var msg = v.create(keys2, null, null, {type: 'test'}, +new Date('2017-04-11 9:09 UTC')) | |
69 … | + t.equal(state.queued, 0) | ||
70 … | + t.equal(state.validated, 3) | ||
71 … | + | ||
66 | 72 … | state = v.queue(state, msg) | |
67 | 73 … | var fstate = state.feeds[keys2.id] | |
68 | 74 … | t.equal(fstate.id, null) | |
69 | 75 … | t.equal(fstate.timestamp, null) | |
70 | 76 … | t.equal(fstate.sequence, null) | |
71 | 77 … | t.deepEqual(fstate.queue, [msg]) | |
72 | 78 … | ||
79 … | + t.equal(state.queued, 1) | ||
80 … | + | ||
73 | 81 … | var msg2 = v.create(keys2, null, fstate, {type: 'test'}, +new Date('2017-04-11 9:10 UTC')) | |
74 | 82 … | state = v.queue(state, msg2) | |
83 … | + t.equal(state.queued, 2) | ||
75 | 84 … | t.notOk(state.error) | |
76 | 85 … | ||
86 … | + t.equal(state.validated, 3) | ||
77 | 87 … | state = v.validate(state, keys2.id) | |
78 | 88 … | ||
89 … | + t.equal(state.validated, 5) | ||
90 … | + t.equal(state.queued, 0) | ||
91 … | + | ||
79 | 92 … | t.end() | |
80 | 93 … | }) | |
81 | 94 … | ||
82 | 95 … | ||
83 | - | ||
84 | - | ||
85 | - |
Built with git-ssb-web