diff --git a/test/goals.test.js b/test/goals.test.js index 8ba73d7..251458b 100644 --- a/test/goals.test.js +++ b/test/goals.test.js @@ -9,7 +9,7 @@ test('set, getByID, list, listen', async (t) => { await alice.db.loaded() const aliceID = await p(alice.db.account.create)({ - domain: 'account', + subdomain: 'account', _nonce: 'alice', }) const aliceAccountRoot = alice.db.getRecord(aliceID) @@ -68,7 +68,7 @@ test('getMsgPurpose', async (t) => { await alice.db.loaded() const aliceID = await p(alice.db.account.create)({ - domain: 'account', + subdomain: 'account', _nonce: 'alice', }) @@ -110,7 +110,7 @@ test('getMsgPurpose ghost', async (t) => { await alice.db.loaded() const aliceID = await p(alice.db.account.create)({ - domain: 'account', + subdomain: 'account', _nonce: 'alice', }) diff --git a/test/util.js b/test/util.js index fed4e5f..dfb9b19 100644 --- a/test/util.js +++ b/test/util.js @@ -6,14 +6,14 @@ const Keypair = require('ppppp-keypair') function createPeer(opts) { if (opts.name) { - opts.path ??= path.join(os.tmpdir(), 'tanglesync-' + opts.name) + opts.db ??= { path: path.join(os.tmpdir(), 'tanglesync-' + opts.name) } opts.keypair ??= Keypair.generate('ed25519', opts.name) opts.name = undefined } - if (!opts.path) throw new Error('need opts.path in createPeer()') + if (!opts.db.path) throw new Error('need opts.db.path in createPeer()') if (!opts.keypair) throw new Error('need opts.keypair in createPeer()') - rimraf.sync(opts.path) + rimraf.sync(opts.db.path) return require('secret-stack/bare')() .use(require('secret-stack/plugins/net')) .use(require('secret-handshake-ext/secret-stack'))