Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit 2b20e87

Browse files
committed
chore: expect uint8arrays
1 parent 8e4db3c commit 2b20e87

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/migrations/migration-10-test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ const { createStore } = require('../../src/utils')
88
const migration = require('../../migrations/migration-10')
99
const Key = require('interface-datastore').Key
1010
const fromString = require('uint8arrays/from-string')
11+
const equals = require('uint8arrays/equals')
1112
const Level5 = require('level-5')
1213
const Level6 = require('level-6')
1314

1415
const keys = {
15-
CIQCKN76QUQUGYCHIKGFE6V6P3GJ2W26YFFPQW6YXV7NFHH3QB2RI3I: 'hello',
16+
CIQCKN76QUQUGYCHIKGFE6V6P3GJ2W26YFFPQW6YXV7NFHH3QB2RI3I: fromString('hello'),
1617
CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ: fromString('derp')
1718
}
1819

@@ -36,7 +37,7 @@ async function validate (dir, backend, repoOptions) {
3637
const key = new Key(`/${name}`)
3738

3839
expect(await store.has(key)).to.be.true(`Could not read key ${name}`)
39-
expect(store.get(key)).to.eventually.equal(keys[name], `Could not read value for key ${keys[name]}`)
40+
expect(equals(await store.get(key), keys[name])).to.be.true(`Could not read value for key ${keys[name]}`)
4041
}
4142

4243
await store.close()

0 commit comments

Comments
 (0)