Skip to content

Commit

Permalink
chore: test a little bit more (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
reconbot authored Dec 8, 2018
1 parent c5acfd6 commit 94dea18
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"eslint-plugin-typescript": "^0.14.0",
"ioredis": "^4.2.0",
"jest": "^23.6.0",
"streaming-iterables": "^3.0.5",
"streaming-iterables": "^3.0.7",
"ts-jest": "^23.10.5",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
Expand Down
5 changes: 3 additions & 2 deletions src/redis-loader.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import bluebird from 'bluebird'
import { collect } from 'bluestream'
import { collect as collectItr } from 'streaming-iterables'
import { collect as collectItr, flatten } from 'streaming-iterables'
import redisLoader from '.'

export const keyPrefix = '_test_'
Expand Down Expand Up @@ -219,13 +219,14 @@ describe('Redis - Loader', () => {
it('paginates', async () => {
const work = []
for (let i = 0; i < 500; i++) {
redis.zadd('foo', String(i), String(i))
redis.zadd('foo', String(i), `member${i}`)
}
await Promise.all(work)
const results = await collectItr(redis.zscanIterable('foo', { count: 10 }))
const { batchCount } = redis.stats
expect(results.length).toBeGreaterThan(1)
expect(batchCount).toBeGreaterThan(1)
expect((await collectItr(flatten(results)))).toHaveLength(1000)
})
})

Expand Down

0 comments on commit 94dea18

Please sign in to comment.