@naturalcycles/db-lib 9.24.0 → 9.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/testing/daoTest.js +8 -0
- package/package.json +1 -1
- package/src/testing/daoTest.ts +11 -0
package/dist/testing/daoTest.js
CHANGED
|
@@ -58,6 +58,14 @@ function runCommonDaoTest(db, quirks = {}) {
|
|
|
58
58
|
test('getByIds(...) should return empty', async () => {
|
|
59
59
|
expect(await dao.getByIds(['abc', 'abcd'])).toEqual([]);
|
|
60
60
|
});
|
|
61
|
+
// TimeMachine
|
|
62
|
+
if (support.timeMachine) {
|
|
63
|
+
test('getByIds(...) 10 minutes ago should return []', async () => {
|
|
64
|
+
expect(await dao.getByIds([item1.id, 'abc'], {
|
|
65
|
+
readAt: js_lib_1.localTime.now().minus(10, 'minute').unix,
|
|
66
|
+
})).toEqual([]);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
61
69
|
// SAVE
|
|
62
70
|
if (support.nullValues) {
|
|
63
71
|
test('should allow to save and load null values', async () => {
|
package/package.json
CHANGED
package/src/testing/daoTest.ts
CHANGED
|
@@ -80,6 +80,17 @@ export function runCommonDaoTest(db: CommonDB, quirks: CommonDBImplementationQui
|
|
|
80
80
|
expect(await dao.getByIds(['abc', 'abcd'])).toEqual([])
|
|
81
81
|
})
|
|
82
82
|
|
|
83
|
+
// TimeMachine
|
|
84
|
+
if (support.timeMachine) {
|
|
85
|
+
test('getByIds(...) 10 minutes ago should return []', async () => {
|
|
86
|
+
expect(
|
|
87
|
+
await dao.getByIds([item1.id, 'abc'], {
|
|
88
|
+
readAt: localTime.now().minus(10, 'minute').unix,
|
|
89
|
+
}),
|
|
90
|
+
).toEqual([])
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
83
94
|
// SAVE
|
|
84
95
|
if (support.nullValues) {
|
|
85
96
|
test('should allow to save and load null values', async () => {
|