Skip to content

Commit

Permalink
test: mysql has no returning 😁
Browse files Browse the repository at this point in the history
  • Loading branch information
farreldarian committed May 29, 2024
1 parent 7474d80 commit adc7351
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/usage/tests/shared/testDisambiguatingRelationship.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createId } from '@paralleldrive/cuid2'
import { inArray } from 'drizzle-orm'
import { matchesId, shouldReturnOne, throwIfnull } from 'tests/utils/query'
import { matchesId, throwIfnull } from 'tests/utils/query'
import type { TestContext } from 'tests/utils/types'

export function testDisambiguatingRelationship(ctx: TestContext) {
Expand Down Expand Up @@ -197,19 +197,17 @@ export function testDisambiguatingRelationship(ctx: TestContext) {
// --

async function prepareCurrency(ctx: TestContext) {
return ctx.db
const currency = { code: createId() }
await ctx.db
.insert(ctx.schema.disambiguatingCurrencies)
.values({ code: createId() })
.returning()
.then(shouldReturnOne)
.values(currency)
return currency
}

async function prepareCountry(ctx: TestContext) {
return ctx.db
.insert(ctx.schema.disambiguatingCountries)
.values({ id: createId() })
.returning()
.then(shouldReturnOne)
const country = { id: createId() }
await ctx.db.insert(ctx.schema.disambiguatingCountries).values(country)
return country
}

async function prepareRelation(
Expand Down

0 comments on commit adc7351

Please sign in to comment.