mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(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
This commit is contained in:
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…
Reference in New Issue
Block a user