Reset PDF tools path for tests in resetDB()

And include path on error when running PDF tool
This commit is contained in:
Dan Stillman 2018-02-05 23:09:17 -05:00
parent 06fb74aafd
commit 45ddf9827c
4 changed files with 10 additions and 13 deletions

View file

@ -566,7 +566,7 @@ var removeDir = Zotero.Promise.coroutine(function* (dir) {
* @param {Object} [options] - Initialization options, as passed to Zotero.init(), overriding
* any that were set at startup
*/
function resetDB(options = {}) {
async function resetDB(options = {}) {
// Hack to avoid CustomizableUI warnings in console from icon.js
var toolbarIconAdded = Zotero.toolbarIconAdded;
resetPrefs();
@ -575,18 +575,17 @@ function resetDB(options = {}) {
options.thisArg.timeout(60000);
}
var db = Zotero.DataDirectory.getDatabase();
return Zotero.reinit(
await Zotero.reinit(
Zotero.Promise.coroutine(function* () {
yield OS.File.remove(db);
_defaultGroup = null;
}),
false,
options
)
.then(() => {
Zotero.toolbarIconAdded = toolbarIconAdded;
return Zotero.Schema.schemaUpdatePromise;
});
);
Zotero.toolbarIconAdded = toolbarIconAdded;
await Zotero.Schema.schemaUpdatePromise;
initPDFToolsPath();
}
/**