git ssb

0+

Piet / ssb-loomio



Commit 34520bc583f5508541b906f83cc6473ee08991e3

Improve test so order of updates is checked.

Piet Geursen committed on 5/10/2018, 10:07:29 PM
Parent: 15faa252573d24fb834a5b13c7db4411cf2edb21

Files changed

test/poll/async/get.test.jschanged
test/poll/async/get.test.jsView
@@ -17,13 +17,16 @@
1717 choices: ['prairie dog', 'kea', 'hermit crab'],
1818 closesAt: nDaysTime(2)
1919 })
2020
21-const agesAgoDate = new Date()
21+const date = new Date()
2222
23-agesAgoDate.setYear(1989)
24-const agesAgo = agesAgoDate.toISOString()
23+date.setYear(1989)
24+const agesAgo = date.toISOString()
2525
26+date.setYear(2020)
27+const soSoon = date.toISOString()
28+
2629 test('pull.async.get', t => {
2730 piet.publish(pollContent, (err, poll) => {
2831 if (err) throw err
2932
@@ -40,8 +43,9 @@
4043 cb(null, t)
4144 })
4245 }),
4346 pull.asyncMap((t, cb) => t.author.publish(t.position, cb)),
47+ pull.asyncMap((m, cb) => UpdatedClosingTime(server)({poll, closesAt: soSoon}, cb)),
4448 pull.asyncMap((m, cb) => UpdatedClosingTime(server)({poll, closesAt: agesAgo}, cb)),
4549 pull.asyncMap((t, cb) => piet.publish(t, cb)),
4650 pull.drain(
4751 m => {}, // console.log(m.value.content.type),

Built with git-ssb-web