We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c13e73 commit bbc9826Copy full SHA for bbc9826
src/service.test.ts
@@ -67,10 +67,15 @@ await test('constructor', () => {
67
const db = new Low<Data>(adapter, defaultData)
68
new Service(db)
69
if (Array.isArray(db.data['posts'])) {
70
- const id = db.data['posts']?.at(1)?.['id']
+ const id0 = db.data['posts']?.at(0)?.['id']
71
+ const id1 = db.data['posts']?.at(1)?.['id']
72
assert.ok(
- typeof id === 'string' && id.length > 0,
73
- `id should be a non empty string but was: ${String(id)}`,
+ typeof id1 === 'string' && id1.length > 0,
74
+ `id should be a non empty string but was: ${String(id1)}`,
75
+ )
76
+ assert.ok(
77
+ typeof id0 === 'string' && id0 === '1',
78
+ `id should not change if already set but was: ${String(id0)}`,
79
)
80
}
81
})
0 commit comments