Skip to content

Commit a253692

Browse files
authored
Merge pull request #10 from wuespace/ai-findings-autofix/tests-hono-e2e.test.ts
Potential fixes for 3 code quality findings
2 parents c538d2b + 6c3a98d commit a253692

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

tests/hono-e2e.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ describe("Hono + Honolate E2E", () => {
3232
});
3333
describe("Untranslated text", () => {
3434
it("GET /untranslated should return untranslated text", async () => {
35-
const resDefault = await (await testApp.untranslated.$get({})).text();
36-
const resEn = await (await testApp.untranslated.$get({
35+
const resDefaultResp = await testApp.untranslated.$get({});
36+
const resDefault = await resDefaultResp.text();
37+
const resEnResp = await testApp.untranslated.$get({
3738
query: { lang: "en" },
38-
})).text();
39-
const resDe = await (await testApp.untranslated.$get({
39+
});
40+
const resEn = await resEnResp.text();
41+
const resDeResp = await testApp.untranslated.$get({
4042
query: { lang: "de" },
41-
})).text();
43+
});
44+
const resDe = await resDeResp.text();
4245

4346
expect(resDefault).toBe("Untranslated text");
4447
expect(resEn).toBe("Untranslated text");
@@ -47,7 +50,8 @@ describe("Hono + Honolate E2E", () => {
4750
});
4851
describe("Lazy translation term", () => {
4952
it("GET /lazy should return localized lazy term", async () => {
50-
const resDefault = await (await testApp.lazy.$get({})).text();
53+
const defaultResp = await testApp.lazy.$get({});
54+
const resDefault = await defaultResp.text();
5155
const resEn = await (await testApp.lazy.$get({
5256
query: { lang: "en" },
5357
})).text();
@@ -62,7 +66,8 @@ describe("Hono + Honolate E2E", () => {
6266
});
6367
describe("Escape test", () => {
6468
it("GET /escape-test should return correctly escaped text", async () => {
65-
const res = await (await testApp["escape-test"].$get({})).text();
69+
const resObj = await testApp["escape-test"].$get({});
70+
const res = await resObj.text();
6671
expect(res).toBe("This text contains 1 {} curly braces and \\{{}}{0}.");
6772
const resDe = await (await testApp["escape-test"].$get({
6873
query: { lang: "de" },

0 commit comments

Comments
 (0)