Skip to content

Commit

Permalink
mock: Decrease writeInterval to speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rhansen committed Apr 19, 2021
1 parent 74f1a19 commit 0043d41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion databases/mock_db.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const events = require('events');
exports.Database = class extends events.EventEmitter {
constructor(settings) {
super();
this.settings = settings;
this.settings = {
writeInterval: 1,
...settings,
};
settings.mock = this;
}

Expand Down
2 changes: 1 addition & 1 deletion test/test_bulk.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe(__filename, function () {
for (const bulkLimit of bulkLimits) {
it(bulkLimit === undefined ? 'undefined' : JSON.stringify(bulkLimit), async function () {
const settings = {};
const udb = new ueberdb.Database('mock', settings, {bulkLimit, writeInterval: 1});
const udb = new ueberdb.Database('mock', settings, {bulkLimit});
mock = settings.mock;
db = {};
for (const fn of ['init', 'close', 'set']) db[fn] = util.promisify(udb[fn].bind(udb));
Expand Down

0 comments on commit 0043d41

Please sign in to comment.