Skip to content

Commit

Permalink
add unit test: lte/gte option are not work (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Feb 7, 2020
1 parent 4c0b635 commit fe6d00e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/flash-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,27 @@ test('first time size', async t => {
// console.info('haha')
})

// To be fixed: https://github.com/huan/flash-store/issues/4
test('values({ optioin: gte/lte })', async t => {
for await (const store of storeFixture()) {
try {
await store.set('a', 3)
await store.set('b', 5)

for await (const value of store.values({ gte: 4 })) {
t.equal(value, 5, 'gte 4 should get 5')
}

for await (const value of store.values({ lte: 4 })) {
t.equal(value, 4, 'lte 4 should get 4')
}

} catch (e) {
t.fail(e || 'rejection')
}
}
})

/**
* Fixtures
*/
Expand Down

0 comments on commit fe6d00e

Please sign in to comment.