Commit 34520bc583f5508541b906f83cc6473ee08991e3
Improve test so order of updates is checked.
Piet Geursen committed on 5/10/2018, 10:07:29 PMParent: 15faa252573d24fb834a5b13c7db4411cf2edb21
Files changed
test/poll/async/get.test.js | changed |
test/poll/async/get.test.js | ||
---|---|---|
@@ -17,13 +17,16 @@ | ||
17 | 17 | choices: ['prairie dog', 'kea', 'hermit crab'], |
18 | 18 | closesAt: nDaysTime(2) |
19 | 19 | }) |
20 | 20 | |
21 | -const agesAgoDate = new Date() | |
21 | +const date = new Date() | |
22 | 22 | |
23 | -agesAgoDate.setYear(1989) | |
24 | -const agesAgo = agesAgoDate.toISOString() | |
23 | +date.setYear(1989) | |
24 | +const agesAgo = date.toISOString() | |
25 | 25 | |
26 | +date.setYear(2020) | |
27 | +const soSoon = date.toISOString() | |
28 | + | |
26 | 29 | test('pull.async.get', t => { |
27 | 30 | piet.publish(pollContent, (err, poll) => { |
28 | 31 | if (err) throw err |
29 | 32 | |
@@ -40,8 +43,9 @@ | ||
40 | 43 | cb(null, t) |
41 | 44 | }) |
42 | 45 | }), |
43 | 46 | pull.asyncMap((t, cb) => t.author.publish(t.position, cb)), |
47 | + pull.asyncMap((m, cb) => UpdatedClosingTime(server)({poll, closesAt: soSoon}, cb)), | |
44 | 48 | pull.asyncMap((m, cb) => UpdatedClosingTime(server)({poll, closesAt: agesAgo}, cb)), |
45 | 49 | pull.asyncMap((t, cb) => piet.publish(t, cb)), |
46 | 50 | pull.drain( |
47 | 51 | m => {}, // console.log(m.value.content.type), |
Built with git-ssb-web