diff --git a/test/from-old-versions.test.js b/test/from-old-versions.test.js index 467e99d..2aa7f1f 100644 --- a/test/from-old-versions.test.js +++ b/test/from-old-versions.test.js @@ -39,16 +39,18 @@ test('can continue from old keyring from ssb-tribes 3.1.3', async t => { // we have to do it this way because we have no normal way of killing a bot that's crashed and therefore releasing its DB locks. const throwChild = childProcess.fork(join(__dirname, 'helpers/throw-bot.js')) - await new Promise((res) => { - throwChild.on("message", (msg) => { + await new Promise((resolve) => { + throwChild.on('message', (msg) => { t.match(msg, /found an old keystore/, "error when there's an old keystore but we don't use it") throwChild.kill() - res() + resolve() }) }) + await p(setTimeout)(500) + const newOpts = { name: 'alice', startUnclean: true diff --git a/test/helpers/test-bot.js b/test/helpers/test-bot.js index cb80fde..fefe1cd 100644 --- a/test/helpers/test-bot.js +++ b/test/helpers/test-bot.js @@ -16,7 +16,7 @@ module.exports = function TestBot (opts = {}) { .use(require('ssb-classic')) .use(require('ssb-db2/compat')) .use(require('ssb-db2/compat/feedstate')) - .use(require("ssb-db2/compat/post")) + .use(require('ssb-db2/compat/post')) .use(require('ssb-box2')) .use(require('../..')) @@ -31,7 +31,7 @@ module.exports = function TestBot (opts = {}) { ...opts.box2 }, // we don't want testbot to import db1 or db2 for us, we want to control what db2 plugins get imported - noDefaultUse: true, + noDefaultUse: true }) if (opts.debug) {