Delete the database once, before tests run

This commit is contained in:
lilia 2015-04-15 18:02:44 -07:00
parent c68bf07409
commit 026f110d36
2 changed files with 10 additions and 6 deletions

View file

@ -73,9 +73,11 @@ function hexToArrayBuffer(str) {
return ret; return ret;
}; };
function deleteDatabase(done) { /* Delete the database before running any tests */
indexedDB.deleteDatabase('test').then(done); before(function(done) {
}; var idbReq = indexedDB.deleteDatabase('test');
idbReq.onsuccess = function() { done(); };
});
function clearDatabase(done) { function clearDatabase(done) {
var convos = new Whisper.ConversationCollection(); var convos = new Whisper.ConversationCollection();

View file

@ -10947,9 +10947,11 @@ function hexToArrayBuffer(str) {
return ret; return ret;
}; };
function deleteDatabase(done) { /* Delete the database before running any tests */
indexedDB.deleteDatabase('test').then(done); before(function(done) {
}; var idbReq = indexedDB.deleteDatabase('test');
idbReq.onsuccess = function() { done(); };
});
function clearDatabase(done) { function clearDatabase(done) {
var convos = new Whisper.ConversationCollection(); var convos = new Whisper.ConversationCollection();