Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
Add description to timeout test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
haad committed Nov 20, 2019
1 parent d4b519e commit fedad84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/log-load.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Object.keys(testAPIs).forEach((IPFS) => {
const st = new Date().getTime()
let log = await Log.fromJSON(ipfs, testIdentity, json, { logId: 'X', timeout })
const et = new Date().getTime()
assert.strictEqual((et - st) > timeout, true)
assert.strictEqual((et - st) > timeout, true, '' + (et - st) + ' should be greater than timeout ' + timeout)
assert.strictEqual(log.length, 0)
assert.deepStrictEqual(log.values.map(e => e.payload), [])
})
Expand Down Expand Up @@ -178,7 +178,7 @@ Object.keys(testAPIs).forEach((IPFS) => {
const st = new Date().getTime()
let log = await Log.fromEntryHash(ipfs, testIdentity, 'zdpuAwNuRc2Kc1aNDdcdSWuxfNpHRJQw8L8APBNHCEFXbogus', { logId: 'X', timeout })
const et = new Date().getTime()
assert.strictEqual((et - st) > timeout, true)
assert.strictEqual((et - st) > timeout, true, '' + (et - st) + ' should be greater than timeout ' + timeout)
assert.strictEqual(log.length, 0)
assert.deepStrictEqual(log.values.map(e => e.payload), [])
})
Expand Down Expand Up @@ -863,14 +863,14 @@ Object.keys(testAPIs).forEach((IPFS) => {
assert.strictEqual(b.values[0].hash, items1[0].hash)
})

it('respects timeout parameter', async () => {
it.only('respects timeout parameter', async () => {
let e = last(items1)
e.hash = 'zdpuAwNuRc2Kc1aNDdcdSWuxfNpHRJQw8L8APBNHCEFXbogus'
const timeout = 500
const st = new Date().getTime()
const log = await Log.fromEntry(ipfs, testIdentity, e, { timeout })
const et = new Date().getTime()
assert.strictEqual((et - st) > timeout, true)
assert.strictEqual((et - st) > timeout, true, '' + (et - st) + ' should be greater than timeout ' + timeout)
assert.strictEqual(log.length, 1)
assert.deepStrictEqual(log.values.map(e => e.payload), [e.payload])
})
Expand Down

0 comments on commit fedad84

Please sign in to comment.