Skip to content

Commit 83fbad0

Browse files
forgot to add these...
1 parent 71d4474 commit 83fbad0

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

dist/search-index-3.3.0.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*!
2+
* The buffer module from node.js, for the browser.
3+
*
4+
* @author Feross Aboukhadijeh <https://feross.org>
5+
* @license MIT
6+
*/
7+
8+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
9+
10+
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
11+
12+
/*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
13+
14+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

dist/search-index-esm-3.3.0.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*!
2+
* The buffer module from node.js, for the browser.
3+
*
4+
* @author Feross Aboukhadijeh <https://feross.org>
5+
* @license MIT
6+
*/
7+
8+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
9+
10+
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
11+
12+
/*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
13+
14+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */

test/src/LAST_UPDATED-test.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
const si = require('../../')
2+
const test = require('tape')
3+
4+
const sandbox = 'test/sandbox/'
5+
const indexName = sandbox + 'LAST_UPDATED'
6+
7+
let timestamp
8+
9+
test('create index', t => {
10+
t.plan(1)
11+
si({ name: indexName }).then(db => {
12+
global[indexName] = db
13+
t.ok(db, !undefined)
14+
})
15+
})
16+
17+
test('timestamp was created', t => {
18+
t.plan(1)
19+
global[indexName].INDEX.STORE.get(['~LAST_UPDATED']).then(lastUpdated => {
20+
timestamp = lastUpdated
21+
return t.pass('timestamp created')
22+
})
23+
})
24+
25+
test('can read LAST_UPDATED timestamp with API', t => {
26+
t.plan(1)
27+
global[indexName].LAST_UPDATED().then(res => t.equals(res, timestamp))
28+
})
29+
30+
test('is valid timestamp', t => {
31+
t.plan(1)
32+
global[indexName].INDEX.STORE.get(['~LAST_UPDATED']).then(lastUpdated =>
33+
t.ok(new Date(lastUpdated))
34+
)
35+
})
36+
37+
test('update index', t => {
38+
t.plan(1)
39+
global[indexName]
40+
.PUT([
41+
{
42+
_id: 0,
43+
body: 'test doc'
44+
}
45+
])
46+
.then(res => t.ok(true))
47+
})
48+
49+
test('LAST_UPDATED timestamp has increased', t => {
50+
t.plan(1)
51+
global[indexName].LAST_UPDATED().then(res => t.ok(res > timestamp))
52+
})

0 commit comments

Comments
 (0)