Skip to content

Commit 0c60180

Browse files
committed
update test
1 parent cb51ed8 commit 0c60180

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

test/03-seed.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const Corestore = require('corestore')
44
const Hyperdrive = require('hyperdrive')
55
const Hyperswarm = require('hyperswarm')
66
const hypercoreid = require('hypercore-id-encoding')
7-
const Localdrive = require('localdrive')
87
const Helper = require('./helper')
98

109
test('pear seed basic stage and seed', async function ({ ok, plan, comment, teardown, timeout }) {
@@ -127,9 +126,9 @@ test('pear seed fully syncs db and blobs cores', async function ({
127126
await sourceStore.ready()
128127
const sourceDrive = new Hyperdrive(sourceStore)
129128
await sourceDrive.ready()
130-
await new Localdrive(Helper.fixture('minimal')).mirror(sourceDrive).done()
129+
await sourceDrive.put('/index.js', 'module.exports = {}\n')
130+
await sourceDrive.put('/test.txt', 'test')
131131
const sourceBlobs = await sourceDrive.getBlobs()
132-
const blocks = sourceDrive.db.core.length + sourceBlobs.core.length
133132

134133
let dbBlocks = 0
135134
sourceDrive.db.core.on('upload', () => dbBlocks++)
@@ -149,12 +148,13 @@ test('pear seed fully syncs db and blobs cores', async function ({
149148
teardown(() => helper.close(), { order: Infinity })
150149
await helper.ready()
151150

152-
comment('seeding external app')
151+
comment('seeding source drive')
153152
const link = `pear://${hypercoreid.encode(sourceDrive.key)}`
154153
const seeding = helper.seed({ link })
155154
teardown(() => Helper.teardownStream(seeding))
156-
await Helper.pick(seeding, { tag: 'stats', data: { download: { totalBlocks: blocks } } })
155+
const totalBlocks = sourceDrive.db.core.length + sourceBlobs.core.length
156+
await Helper.pick(seeding, { tag: 'stats', data: { download: { totalBlocks } } })
157157

158-
is(dbBlocks, sourceDrive.db.core.length, 'seed synced db core')
159-
is(blobBlocks, sourceBlobs.core.length, 'seed synced blobs core')
158+
is(dbBlocks, sourceDrive.db.core.length, 'synced db core')
159+
is(blobBlocks, sourceBlobs.core.length, 'synced blobs core')
160160
})

0 commit comments

Comments
 (0)