Run migrations before clearing database during tests
This commit is contained in:
@@ -66,18 +66,19 @@ before(function(done) {
|
|||||||
idbReq.onsuccess = function() { done(); };
|
idbReq.onsuccess = function() { done(); };
|
||||||
});
|
});
|
||||||
|
|
||||||
function clearDatabase(done) {
|
async function clearDatabase(done) {
|
||||||
var convos = new Whisper.ConversationCollection();
|
await Signal.Migrations.Migrations0DatabaseWithAttachmentData.run({
|
||||||
return convos.fetch().then(function() {
|
Backbone,
|
||||||
convos.destroyAll().then(function() {
|
databaseName: Whisper.Database.id,
|
||||||
var messages = new Whisper.MessageCollection();
|
});
|
||||||
return messages.fetch().then(function() {
|
|
||||||
messages.destroyAll().then(function() {
|
const convos = new Whisper.ConversationCollection();
|
||||||
|
await convos.fetch();
|
||||||
|
await convos.destroyAll();
|
||||||
|
const messages = new Whisper.MessageCollection();
|
||||||
|
await messages.fetch();
|
||||||
|
await messages.destroyAll();
|
||||||
if (done) {
|
if (done) {
|
||||||
done();
|
done();
|
||||||
}
|
};
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user