zotero/test/tests/support.js
Dan Stillman 973e602cfc Enable Bluebird generator support in Mocha
Promise-yielding ES6 generator functions can now be used for test
functions, and they'll automatically be wrapped with Bluebird's
coroutine().
2015-04-15 01:35:53 -04:00

14 lines
494 B
JavaScript

describe("Support Functions for Unit Testing", function() {
describe("resetDB", function() {
it("should restore the DB to factory settings", function* () {
this.timeout(30000);
yield Zotero.Items.erase(1);
assert.isFalse(yield Zotero.Items.getAsync(1));
yield resetDB();
var item = yield Zotero.Items.getAsync(1);
assert.isObject(item);
yield item.loadItemData();
assert.equal(item.getField("url"), "https://www.zotero.org/support/quick_start_guide");
});
});
});