Add support function to reset the DB and a test that it works.
This commit is contained in:
parent
b6673511f7
commit
c7c58f8343
5 changed files with 41 additions and 2 deletions
|
@ -164,4 +164,15 @@ function getTestDataDirectory() {
|
|||
resURI = Services.io.newURI("resource://zotero-unit-tests/data", null, null);
|
||||
return Services.io.newURI(resource.resolveURI(resURI), null, null).
|
||||
QueryInterface(Components.interfaces.nsIFileURL).file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the Zotero DB and restarts Zotero. Returns a promise resolved
|
||||
* when this finishes.
|
||||
*/
|
||||
function resetDB() {
|
||||
var db = Zotero.getZoteroDatabase();
|
||||
return Zotero.reinit(function() {
|
||||
db.remove(false);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue