Skip to content

Commit

Permalink
fix: keyValueDaoTest types
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Oct 17, 2024
1 parent 8582a1c commit 4af1e7f
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 142 deletions.
13 changes: 5 additions & 8 deletions src/testing/keyValueDaoTest.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { _sortBy, KeyValueTuple } from '@naturalcycles/js-lib'
import { _sortBy } from '@naturalcycles/js-lib'
import { CommonKeyValueDao } from '../kv/commonKeyValueDao'
import { CommonKeyValueDB } from '../kv/commonKeyValueDB'
import { createTestItemsBM, TEST_TABLE, TestItemBM } from './test.model'
import { CommonKeyValueDB, KeyValueDBTuple } from '../kv/commonKeyValueDB'
import { createTestItemsBM, TEST_TABLE } from './test.model'

const testItems = createTestItemsBM(4)
const testIds = testItems.map(e => e.id)
const testEntries: KeyValueTuple<string, any>[] = testItems.map(e => [
e.id,
Buffer.from(`${e.id}value`),
])
const testEntries: KeyValueDBTuple[] = testItems.map(e => [e.id, Buffer.from(`${e.id}value`)])

export function runCommonKeyValueDaoTest(db: CommonKeyValueDB): void {
const dao = new CommonKeyValueDao<string, TestItemBM>({
const dao = new CommonKeyValueDao({
db,
table: TEST_TABLE,
// todo: make this test support "deflatedJson" transformer
Expand Down
Loading

0 comments on commit 4af1e7f

Please sign in to comment.