Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
HYP-13: onchain tests>'
Browse files Browse the repository at this point in the history
  • Loading branch information
n3op2 committed Nov 21, 2023
1 parent e13c586 commit 2d66a06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/lib/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ export default class Database {
return query().insert(record).returning('*')
}

delete = async (model: keyof Models<() => QueryBuilder>, where: Record<string, string | number>) => {
return this.db()[model]().where(where || {}).delete()

Check failure on line 86 in src/lib/db/index.ts

View workflow job for this annotation

GitHub Actions / Run lint

Replace `[model]().where(where·||·{})` with `⏎······[model]()⏎······.where(where·||·{})⏎······`
}

update = async (
model: keyof Models<() => QueryBuilder>,
where: Record<string, string>,
Expand Down
4 changes: 2 additions & 2 deletions test/integration/onchain/chain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ describe('on-chain', function () {
withIdentitySelfMock()

beforeEach(async function () {
await db['transaction']().del()
await db.delete('transaction', {})
})

afterEach(async function () {
await db['transaction']().del()
await db.delete('transaction', {})
})

describe('chainNode', () => {
Expand Down

0 comments on commit 2d66a06

Please sign in to comment.