From bc75632a02c84ad1a13f4a2eb2e070f30b077bdc Mon Sep 17 00:00:00 2001 From: Wang Zuo Date: Mon, 25 Sep 2023 19:32:42 +0800 Subject: [PATCH] fix prettier --- internal/integration/client.test.ts | 48 ++++++++++++++--------------- internal/integration/package.json | 3 ++ internal/integration/yarn.lock | 5 +++ 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/internal/integration/client.test.ts b/internal/integration/client.test.ts index 71645ec4..66f30c3d 100644 --- a/internal/integration/client.test.ts +++ b/internal/integration/client.test.ts @@ -12,7 +12,7 @@ test("queryOne", async () => { let user = await c.queryUser().create({ name: "test" }); let row = await c.queryOne<{ user_id: number }>( "select id as user_id from users where id = ?", - user.id + user.id, ); expect(row.user_id).toEqual(user.id); }); @@ -22,7 +22,7 @@ test("query", async () => { let user2 = await c.queryUser().create({ name: "test2" }); let rows = await c.query<{ user_name: string }>( "select name as user_name from users where id in (?)", - [user1.id, user2.id] + [user1.id, user2.id], ); expect(rows).toEqual([{ user_name: "test1" }, { user_name: "test2" }]); }); @@ -32,7 +32,7 @@ test("exec", async () => { let updated = await c.exec( "update users set name = ? where id = ?", "test1", - user.id + user.id, ); expect(updated).toEqual(1); let deleted = await c.exec("delete from users where id = ?", user.id); @@ -122,7 +122,7 @@ test("datetime", async () => { c.userID .eq(user.id) .and(c.userDatetime.gte(s1)) - .and(c.userDatetime.lte(s1)) + .and(c.userDatetime.lte(s1)), ) .first(); expect(format(user.datetime!, "yyyy-MM-dd HH:mm:ss")).toEqual(s1); @@ -365,35 +365,35 @@ test("transaction", async () => { }); test("transactionBlock", async () => { - await c.queryTag().deleteAll() + await c.queryTag().deleteAll(); - let tag1 = await c.queryTag().create({name: "tag1"}); - expect(tag1.name).toEqual("tag1"); + let tag1 = await c.queryTag().create({ name: "tag1" }); + expect(tag1.name).toEqual("tag1"); - let total1 = await c.queryTag().count(); + let total1 = await c.queryTag().count(); - await c.transaction(async function (tx: Tx) { - tag1 = await tx.queryTag().find(tag1.id); - await tag1.update({name: "tag1-updated"}); + await c.transaction(async function (tx: Tx) { + tag1 = await tx.queryTag().find(tag1.id); + await tag1.update({ name: "tag1-updated" }); - await tx.queryTag().create({name: "tag2"}); - await tx.queryTag().create({name: "tag3"}); + await tx.queryTag().create({ name: "tag2" }); + await tx.queryTag().create({ name: "tag3" }); - let total2 = await c.queryTag().count(); - expect(total2).toEqual(total1); + let total2 = await c.queryTag().count(); + expect(total2).toEqual(total1); - let total3 = await tx.queryTag().count(); - expect(total3).toEqual(total1 + 2); + let total3 = await tx.queryTag().count(); + expect(total3).toEqual(total1 + 2); - tag1 = await c.queryTag().find(tag1.id); - expect(tag1.name).toEqual("tag1"); - }) + tag1 = await c.queryTag().find(tag1.id); + expect(tag1.name).toEqual("tag1"); + }); - let total4 = await c.queryTag().count(); - expect(total4).toEqual(total1 + 2); + let total4 = await c.queryTag().count(); + expect(total4).toEqual(total1 + 2); - tag1 = await c.queryTag().find(tag1.id); - expect(tag1.name).toEqual("tag1-updated"); + tag1 = await c.queryTag().find(tag1.id); + expect(tag1.name).toEqual("tag1-updated"); }); test("changeJSON", async () => { diff --git a/internal/integration/package.json b/internal/integration/package.json index 518b8f81..4808486e 100644 --- a/internal/integration/package.json +++ b/internal/integration/package.json @@ -16,5 +16,8 @@ "pg": "^8.11.1", "typescript": "^5.1.6", "vitest": "^0.32.2" + }, + "devDependencies": { + "prettier": "^3.0.3" } } diff --git a/internal/integration/yarn.lock b/internal/integration/yarn.lock index 1af1c4f7..71282e99 100644 --- a/internal/integration/yarn.lock +++ b/internal/integration/yarn.lock @@ -815,6 +815,11 @@ prebuild-install@^7.1.0: tar-fs "^2.0.0" tunnel-agent "^0.6.0" +prettier@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== + pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"