Skip to content

Commit

Permalink
test: add more
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jan 7, 2024
1 parent 6c13e73 commit bbc9826
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/service.test.ts
Expand Up @@ -67,10 +67,15 @@ await test('constructor', () => {
const db = new Low<Data>(adapter, defaultData)
new Service(db)
if (Array.isArray(db.data['posts'])) {
const id = db.data['posts']?.at(1)?.['id']
const id0 = db.data['posts']?.at(0)?.['id']
const id1 = db.data['posts']?.at(1)?.['id']
assert.ok(
typeof id === 'string' && id.length > 0,
`id should be a non empty string but was: ${String(id)}`,
typeof id1 === 'string' && id1.length > 0,
`id should be a non empty string but was: ${String(id1)}`,
)
assert.ok(
typeof id0 === 'string' && id0 === '1',
`id should not change if already set but was: ${String(id0)}`,
)
}
})
Expand Down

0 comments on commit bbc9826

Please sign in to comment.