From 94dea188e7e0972e284fdfc755815dba37f7179e Mon Sep 17 00:00:00 2001 From: Francis Gulotta Date: Fri, 7 Dec 2018 19:34:23 -0500 Subject: [PATCH] chore: test a little bit more (#17) --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 2 +- src/redis-loader.test.ts | 5 +++-- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7ebfc3d..5d3995f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ }, "ansi-escapes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, @@ -588,7 +588,7 @@ "dependencies": { "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -601,7 +601,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -1043,7 +1043,7 @@ }, "callsites": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, @@ -1676,7 +1676,7 @@ }, "eslint-config-standard": { "version": "11.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz", + "resolved": "http://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz", "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==", "dev": true }, @@ -3146,7 +3146,7 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { @@ -4063,7 +4063,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { @@ -4261,7 +4261,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, @@ -4288,7 +4288,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -4588,7 +4588,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -4672,7 +4672,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -5110,7 +5110,7 @@ }, "require-uncached": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { @@ -5896,9 +5896,9 @@ "dev": true }, "streaming-iterables": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/streaming-iterables/-/streaming-iterables-3.0.5.tgz", - "integrity": "sha512-k9NDQ2N0JP7IOU/xwsM7uynb9k1MLmacxoovOFjS8QsN3jiFZSsSTSmqXDsfucoVCpHeWLdPXHmtTt/CYwV2Tw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/streaming-iterables/-/streaming-iterables-3.0.7.tgz", + "integrity": "sha512-zgOtPLq87zzhAzYzsjngd3doiWfaOmVDLrVmrhekdAmxh4FGlhNI/l1IWP7zMpVWbyAuT7USNLV+YDQKMZ9REQ==", "dev": true }, "string-length": { @@ -6099,7 +6099,7 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, diff --git a/package.json b/package.json index 33311ff..5fc5050 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/redis-loader.test.ts b/src/redis-loader.test.ts index 7ba57a0..f6ca7ca 100644 --- a/src/redis-loader.test.ts +++ b/src/redis-loader.test.ts @@ -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_' @@ -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) }) })