mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
[local-sync] Properly clean-up in-memory test database
Summary: There's no file to unlink, we just need to drop the tables. Test Plan: manual Reviewers: evan, juan Reviewed By: evan, juan Differential Revision: https://phab.nylas.com/D3878
This commit is contained in:
parent
e646d56bf8
commit
2d3bb52bc8
1 changed files with 9 additions and 0 deletions
|
@ -65,6 +65,14 @@ class LocalDatabaseConnector {
|
|||
}
|
||||
|
||||
destroyAccountDatabase(accountId) {
|
||||
if (NylasEnv.inSpecMode()) {
|
||||
// The db is in memory, so we don't have to unlink it. Just drop the data.
|
||||
return this.forAccount(accountId).then(db => {
|
||||
delete this._cache[accountId];
|
||||
return db.sequelize.drop()
|
||||
});
|
||||
}
|
||||
|
||||
const dbname = `a-${accountId}`;
|
||||
const dbpath = path.join(process.env.NYLAS_HOME, `${dbname}.sqlite`);
|
||||
|
||||
|
@ -78,6 +86,7 @@ class LocalDatabaseConnector {
|
|||
}
|
||||
|
||||
delete this._cache[accountId];
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
_sequelizeForShared() {
|
||||
|
|
Loading…
Reference in a new issue