From adc73511a0845832b6a6fe17214d4a5b5e56c65a Mon Sep 17 00:00:00 2001 From: farreldarian Date: Wed, 29 May 2024 19:56:23 +0700 Subject: [PATCH] =?UTF-8?q?test:=20mysql=20has=20no=20returning=20?= =?UTF-8?q?=F0=9F=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shared/testDisambiguatingRelationship.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/usage/tests/shared/testDisambiguatingRelationship.ts b/packages/usage/tests/shared/testDisambiguatingRelationship.ts index 50e0de7..046ac1b 100644 --- a/packages/usage/tests/shared/testDisambiguatingRelationship.ts +++ b/packages/usage/tests/shared/testDisambiguatingRelationship.ts @@ -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) { @@ -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(