mobiletto 1.0.45 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/test/index.spec.js +21 -1
- package/util/redis.js +1 -1
package/package.json
CHANGED
package/test/index.spec.js
CHANGED
|
@@ -176,6 +176,16 @@ for (const driverName of DRIVER_NAMES) {
|
|
|
176
176
|
const nonexistentFile = 'random_file_that_does_not_exist_' + rand(100) + '_' + Date.now()
|
|
177
177
|
const tempFilename = (name, i) => name + (i > 0 ? '_' + i : '')
|
|
178
178
|
describe(`${driverName} test`, () => {
|
|
179
|
+
beforeEach ((done) => {
|
|
180
|
+
redis.flushMobiletto().then(
|
|
181
|
+
() => { logger.info(`${driverName} - flushed redis`) },
|
|
182
|
+
(e) => {
|
|
183
|
+
logger.error(`${driverName} - error flushing redis: ${e}`)
|
|
184
|
+
throw e
|
|
185
|
+
}
|
|
186
|
+
).finally(() => done())
|
|
187
|
+
})
|
|
188
|
+
|
|
179
189
|
describe(`${driverName} - create api client`, () => {
|
|
180
190
|
it("should validate the config and return an API object", async () => {
|
|
181
191
|
const api = await mobiletto(driverName, config.key, config.secret, config.opts)
|
|
@@ -412,7 +422,6 @@ for (const driverName of DRIVER_NAMES) {
|
|
|
412
422
|
}
|
|
413
423
|
})
|
|
414
424
|
it(`should mirror its subdirectory (${driverName}/${randomParent}) to another place (${mirrorDriver}/${mirrorDest})`, async () => {
|
|
415
|
-
await redis.flushMobiletto()
|
|
416
425
|
const results = await fixture.mirrorApi.mirror(fixture.api, mirrorDest, randomParent)
|
|
417
426
|
expect(results).to.have.property('errors', 0, 'expected no errors in mirroring')
|
|
418
427
|
expect(results).to.have.property('success').greaterThan(0, 'expected some successes in mirroring')
|
|
@@ -503,3 +512,14 @@ for (const driverName of DRIVER_NAMES) {
|
|
|
503
512
|
})
|
|
504
513
|
})
|
|
505
514
|
}
|
|
515
|
+
|
|
516
|
+
after ((done) => {
|
|
517
|
+
try {
|
|
518
|
+
logger.info('all tests finished, tearing down redis...')
|
|
519
|
+
redis.teardown()
|
|
520
|
+
} catch (e) {
|
|
521
|
+
logger.warn(`error calling redis.teardown: ${e}`)
|
|
522
|
+
} finally {
|
|
523
|
+
done()
|
|
524
|
+
}
|
|
525
|
+
})
|