(core) clear redis state for docapi tests

Summary:
DocApi tests occasionally fail in a confusing way due to redis
state. This resets the redis state at the beginning of the test.

Test Plan: existing tests pass

Reviewers: alexmojaki

Reviewed By: alexmojaki

Subscribers: alexmojaki

Differential Revision: https://phab.getgrist.com/D3424
pull/203/head
Paul Fitzpatrick 2 years ago
parent 87cc7d755d
commit 0a61d740ba

@ -67,6 +67,13 @@ describe('DocApi', function() {
const oldEnv = clone(process.env);
before(async function() {
// Clear redis test database if redis is in use.
if (process.env.TEST_REDIS_URL) {
const cli = createClient(process.env.TEST_REDIS_URL);
await cli.flushdbAsync();
await cli.quitAsync();
}
// Create the tmp dir removing any previous one
await fse.remove(tmpDir);
await fse.mkdirs(tmpDir);

Loading…
Cancel
Save