Skip to content

Commit bbc9826

Browse files
committed
test: add more
1 parent 6c13e73 commit bbc9826

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/service.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ await test('constructor', () => {
6767
const db = new Low<Data>(adapter, defaultData)
6868
new Service(db)
6969
if (Array.isArray(db.data['posts'])) {
70-
const id = db.data['posts']?.at(1)?.['id']
70+
const id0 = db.data['posts']?.at(0)?.['id']
71+
const id1 = db.data['posts']?.at(1)?.['id']
7172
assert.ok(
72-
typeof id === 'string' && id.length > 0,
73-
`id should be a non empty string but was: ${String(id)}`,
73+
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)}`,
7479
)
7580
}
7681
})

0 commit comments

Comments
 (0)