Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fergiemcdowall committed Aug 22, 2023
1 parent 0606d71 commit 0846d29
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/src/LAST_UPDATED-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ test('create a search index', t => {
t.plan(1)
try {
global[indexName] = new SearchIndex({ name: indexName })
// wait a bit...
setTimeout(() => {
t.ok(global[indexName])
}, 10)
t.ok(global[indexName])
} catch (e) {
t.error(e)
}
})

test('timeout here to deal with there no longer being a callback/promise on the constructor', t => {
t.plan(1)
setTimeout(() => {
t.ok(global[indexName])
}, 100)
})

test('timestamp was created', t => {
t.plan(1)
global[indexName].INDEX.STORE.get(
['~LAST_UPDATED'],
global[indexName].INDEX.LEVEL_OPTIONS
).then(lastUpdated => {
global[indexName].INDEX.STORE.get(['~LAST_UPDATED']).then(lastUpdated => {
timestamp = lastUpdated
return t.pass('timestamp created')
})
Expand All @@ -38,10 +39,9 @@ test('can read LAST_UPDATED timestamp with API', t => {

test('is valid timestamp', t => {
t.plan(1)
global[indexName].INDEX.STORE.get(
['~LAST_UPDATED'],
global[indexName].INDEX.LEVEL_OPTIONS
).then(lastUpdated => t.ok(new Date(lastUpdated)))
global[indexName].INDEX.STORE.get(['~LAST_UPDATED']).then(lastUpdated =>
t.ok(new Date(lastUpdated))
)
})

test('update index', t => {
Expand Down

0 comments on commit 0846d29

Please sign in to comment.