Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Powersource committed Nov 1, 2023
1 parent 8bd577c commit aac8cfe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
25 changes: 12 additions & 13 deletions test/from-old-versions.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const fsPromise = require('fs/promises')
const test = require('tape')
const { promisify: p } = require('util')

Expand All @@ -19,35 +18,35 @@ test('can continue from old keyring from ssb-tribes 3.1.3', async t => {

const oldGroup = await p(oldAlice.tribes.create)({})

t.equal(typeof oldGroup.groupId, 'string', "got a group id when creating using old bot")
t.equal(typeof oldGroup.groupId, 'string', 'got a group id when creating using old bot')

const oldList = await p(oldAlice.tribes.list)()
t.deepEqual(oldList, [oldGroup.groupId], 'group got listed by old bot')

const oldGet = await p(oldAlice.tribes.get)(oldGroup.groupId)

t.equal(oldGet.groupId, oldGroup.groupId, "got correct groupId")
t.equal(oldGet.key, oldGroup.groupKey, "got correct key")
t.equal(typeof oldGet.scheme, "string", "got scheme")
t.equal(typeof oldGet.root, "string", "got root")
t.equal(oldGet.groupId, oldGroup.groupId, 'got correct groupId')
t.equal(oldGet.key, oldGroup.groupKey, 'got correct key')
t.equal(typeof oldGet.scheme, 'string', 'got scheme')
t.equal(typeof oldGet.root, 'string', 'got root')

await p(oldAlice.close)(true)

await p(setTimeout)(500)

const newOpts = {
name: 'alice',
startUnclean: true,
startUnclean: true
}

//t.throws(() => {
// t.throws(() => {
// NewBot(newOpts)
//}, /found an old keystore/, "Error when there's an old keystore but we don't use it")
// }, /found an old keystore/, "Error when there's an old keystore but we don't use it")

const newAlice = NewBot({
...newOpts,
box2: {
path: 'tribes/keystore',
path: 'tribes/keystore'
}
})

Expand All @@ -60,8 +59,8 @@ test('can continue from old keyring from ssb-tribes 3.1.3', async t => {
groupId: oldGet.groupId,
writeKey: { key: oldGet.key, scheme: oldGet.scheme },
readKeys: [{ key: oldGet.key, scheme: oldGet.scheme }],
root: oldGet.root,
}, "get with new bot matches get with old bot")
root: oldGet.root
}, 'get with new bot matches get with old bot')

await p(newAlice.close)()
})
})
4 changes: 2 additions & 2 deletions test/helpers/test-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ module.exports = function TestBot (opts = {}) {
...opts,
box2: {
legacyMode: true,
...opts.box2,
...opts.box2
},
// we don't want testbot to import db2 for us, we want more granularity and control of dep versions
db1: true,
db1: true
})

if (opts.debug) {
Expand Down

0 comments on commit aac8cfe

Please sign in to comment.