Skip to content

Commit e269992

Browse files
chore: rename tests FreshApp -> App (#3087)
1 parent a941dd3 commit e269992

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/app_test.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { App, getIslandRegistry, setBuildCache } from "./app.ts";
33
import { FakeServer } from "./test_utils.ts";
44
import { ProdBuildCache } from "./build_cache.ts";
55

6-
Deno.test("FreshApp - .use()", async () => {
6+
Deno.test("App - .use()", async () => {
77
const app = new App<{ text: string }>()
88
.use((ctx) => {
99
ctx.state.text = "A";
@@ -21,7 +21,7 @@ Deno.test("FreshApp - .use()", async () => {
2121
expect(await res.text()).toEqual("AB");
2222
});
2323

24-
Deno.test("FreshApp - .use() #2", async () => {
24+
Deno.test("App - .use() #2", async () => {
2525
const app = new App<{ text: string }>()
2626
.use(() => new Response("ok #1"))
2727
.get("/foo/bar", () => new Response("ok #2"))
@@ -33,7 +33,7 @@ Deno.test("FreshApp - .use() #2", async () => {
3333
expect(await res.text()).toEqual("ok #1");
3434
});
3535

36-
Deno.test("FreshApp - .get()", async () => {
36+
Deno.test("App - .get()", async () => {
3737
const app = new App()
3838
.post("/", () => new Response("ok"))
3939
.post("/foo", () => new Response("ok"))
@@ -49,7 +49,7 @@ Deno.test("FreshApp - .get()", async () => {
4949
expect(await res.text()).toEqual("ok");
5050
});
5151

52-
Deno.test("FreshApp - .get() with basePath", async () => {
52+
Deno.test("App - .get() with basePath", async () => {
5353
const app = new App({ basePath: "/foo/bar" })
5454
.get("/", () => new Response("ok"))
5555
.get("/foo", () => new Response("ok"));
@@ -67,7 +67,7 @@ Deno.test("FreshApp - .get() with basePath", async () => {
6767
expect(res.status).toEqual(200);
6868
});
6969

70-
Deno.test("FreshApp - .post()", async () => {
70+
Deno.test("App - .post()", async () => {
7171
const app = new App<{ text: string }>()
7272
.get("/", () => new Response("fail"))
7373
.get("/foo", () => new Response("fail"))
@@ -83,7 +83,7 @@ Deno.test("FreshApp - .post()", async () => {
8383
expect(await res.text()).toEqual("ok");
8484
});
8585

86-
Deno.test("FreshApp - .post() with basePath", async () => {
86+
Deno.test("App - .post() with basePath", async () => {
8787
const app = new App({ basePath: "/foo/bar" })
8888
.post("/", () => new Response("ok"))
8989
.post("/foo", () => new Response("ok"));
@@ -101,7 +101,7 @@ Deno.test("FreshApp - .post() with basePath", async () => {
101101
expect(res.status).toEqual(200);
102102
});
103103

104-
Deno.test("FreshApp - .patch()", async () => {
104+
Deno.test("App - .patch()", async () => {
105105
const app = new App<{ text: string }>()
106106
.get("/", () => new Response("fail"))
107107
.get("/foo", () => new Response("fail"))
@@ -117,7 +117,7 @@ Deno.test("FreshApp - .patch()", async () => {
117117
expect(await res.text()).toEqual("ok");
118118
});
119119

120-
Deno.test("FreshApp - .patch() with basePath", async () => {
120+
Deno.test("App - .patch() with basePath", async () => {
121121
const app = new App({ basePath: "/foo/bar" })
122122
.patch("/", () => new Response("ok"))
123123
.patch("/foo", () => new Response("ok"));
@@ -135,7 +135,7 @@ Deno.test("FreshApp - .patch() with basePath", async () => {
135135
expect(res.status).toEqual(200);
136136
});
137137

138-
Deno.test("FreshApp - .put()", async () => {
138+
Deno.test("App - .put()", async () => {
139139
const app = new App<{ text: string }>()
140140
.get("/", () => new Response("fail"))
141141
.get("/foo", () => new Response("fail"))
@@ -151,7 +151,7 @@ Deno.test("FreshApp - .put()", async () => {
151151
expect(await res.text()).toEqual("ok");
152152
});
153153

154-
Deno.test("FreshApp - .put() with basePath", async () => {
154+
Deno.test("App - .put() with basePath", async () => {
155155
const app = new App({ basePath: "/foo/bar" })
156156
.put("/", () => new Response("ok"))
157157
.put("/foo", () => new Response("ok"));
@@ -169,7 +169,7 @@ Deno.test("FreshApp - .put() with basePath", async () => {
169169
expect(res.status).toEqual(200);
170170
});
171171

172-
Deno.test("FreshApp - .delete()", async () => {
172+
Deno.test("App - .delete()", async () => {
173173
const app = new App<{ text: string }>()
174174
.get("/", () => new Response("fail"))
175175
.get("/foo", () => new Response("fail"))
@@ -185,7 +185,7 @@ Deno.test("FreshApp - .delete()", async () => {
185185
expect(await res.text()).toEqual("ok");
186186
});
187187

188-
Deno.test("FreshApp - .delete() with basePath", async () => {
188+
Deno.test("App - .delete() with basePath", async () => {
189189
const app = new App({ basePath: "/foo/bar" })
190190
.delete("/", () => new Response("ok"))
191191
.delete("/foo", () => new Response("ok"));
@@ -203,7 +203,7 @@ Deno.test("FreshApp - .delete() with basePath", async () => {
203203
expect(res.status).toEqual(200);
204204
});
205205

206-
Deno.test("FreshApp - wrong method match", async () => {
206+
Deno.test("App - wrong method match", async () => {
207207
const app = new App<{ text: string }>()
208208
.get("/", () => new Response("ok"))
209209
.post("/", () => new Response("ok"));
@@ -219,7 +219,7 @@ Deno.test("FreshApp - wrong method match", async () => {
219219
expect(await res.text()).toEqual("ok");
220220
});
221221

222-
Deno.test("FreshApp - methods with middleware", async () => {
222+
Deno.test("App - methods with middleware", async () => {
223223
const app = new App<{ text: string }>()
224224
.use((ctx) => {
225225
ctx.state.text = "A";
@@ -237,7 +237,7 @@ Deno.test("FreshApp - methods with middleware", async () => {
237237
expect(await res.text()).toEqual("A");
238238
});
239239

240-
Deno.test("FreshApp - .mountApp() compose apps", async () => {
240+
Deno.test("App - .mountApp() compose apps", async () => {
241241
const innerApp = new App<{ text: string }>()
242242
.use((ctx) => {
243243
ctx.state.text = "A";
@@ -262,7 +262,7 @@ Deno.test("FreshApp - .mountApp() compose apps", async () => {
262262
expect(await res.text()).toEqual("A");
263263
});
264264

265-
Deno.test("FreshApp - .mountApp() self mount, no middleware", async () => {
265+
Deno.test("App - .mountApp() self mount, no middleware", async () => {
266266
const innerApp = new App<{ text: string }>()
267267
.use((ctx) => {
268268
ctx.state.text = "A";
@@ -288,7 +288,7 @@ Deno.test("FreshApp - .mountApp() self mount, no middleware", async () => {
288288
});
289289

290290
Deno.test(
291-
"FreshApp - .mountApp() self mount, with middleware",
291+
"App - .mountApp() self mount, with middleware",
292292
async () => {
293293
const innerApp = new App<{ text: string }>()
294294
.use(function B(ctx) {
@@ -320,7 +320,7 @@ Deno.test(
320320
);
321321

322322
Deno.test(
323-
"FreshApp - .mountApp() self mount, different order",
323+
"App - .mountApp() self mount, different order",
324324
async () => {
325325
const innerApp = new App<{ text: string }>()
326326
.get("/foo", (ctx) => new Response(ctx.state.text))
@@ -351,7 +351,7 @@ Deno.test(
351351
},
352352
);
353353

354-
Deno.test("FreshApp - .mountApp() self mount empty", async () => {
354+
Deno.test("App - .mountApp() self mount empty", async () => {
355355
const innerApp = new App<{ text: string }>()
356356
.use((ctx) => {
357357
ctx.state.text = "A";
@@ -369,7 +369,7 @@ Deno.test("FreshApp - .mountApp() self mount empty", async () => {
369369
});
370370

371371
Deno.test(
372-
"FreshApp - .mountApp() self mount with middleware",
372+
"App - .mountApp() self mount with middleware",
373373
async () => {
374374
const innerApp = new App<{ text: string }>()
375375
.use(function Inner(ctx) {
@@ -392,7 +392,7 @@ Deno.test(
392392
},
393393
);
394394

395-
Deno.test("FreshApp - catches errors", async () => {
395+
Deno.test("App - catches errors", async () => {
396396
let thrownErr: unknown | null = null;
397397
const app = new App<{ text: string }>()
398398
.use(async (ctx) => {
@@ -416,7 +416,7 @@ Deno.test("FreshApp - catches errors", async () => {
416416
});
417417

418418
// TODO: Find a better way to test this
419-
Deno.test.ignore("FreshApp - finish setup", async () => {
419+
Deno.test.ignore("App - finish setup", async () => {
420420
const app = new App<{ text: string }>()
421421
.get("/", (ctx) => {
422422
return ctx.render(<div>ok</div>);
@@ -439,7 +439,7 @@ Deno.test.ignore("FreshApp - finish setup", async () => {
439439
expect(res.status).toEqual(500);
440440
});
441441

442-
Deno.test("FreshApp - sets error on context", async () => {
442+
Deno.test("App - sets error on context", async () => {
443443
const thrown: [unknown, unknown][] = [];
444444
const app = new App()
445445
.use(async (ctx) => {
@@ -471,7 +471,7 @@ Deno.test("FreshApp - sets error on context", async () => {
471471
expect(thrown[1][0]).toEqual(thrown[1][1]);
472472
});
473473

474-
Deno.test("FreshApp - support setting request init in ctx.render()", async () => {
474+
Deno.test("App - support setting request init in ctx.render()", async () => {
475475
const app = new App<{ text: string }>()
476476
.get("/", (ctx) => {
477477
return ctx.render(<div>ok</div>, {
@@ -487,7 +487,7 @@ Deno.test("FreshApp - support setting request init in ctx.render()", async () =>
487487
expect(res.headers.get("X-Foo")).toEqual("foo");
488488
});
489489

490-
Deno.test("FreshApp - throw when middleware returns no response", async () => {
490+
Deno.test("App - throw when middleware returns no response", async () => {
491491
const app = new App<{ text: string }>()
492492
.get(
493493
"/",
@@ -502,7 +502,7 @@ Deno.test("FreshApp - throw when middleware returns no response", async () => {
502502
expect(text).toContain("Internal server error");
503503
});
504504

505-
Deno.test("FreshApp - adding Island should convert to valid export names", () => {
505+
Deno.test("App - adding Island should convert to valid export names", () => {
506506
const app = new App();
507507
const islands = getIslandRegistry(app);
508508

@@ -533,7 +533,7 @@ Deno.test("FreshApp - adding Island should convert to valid export names", () =>
533533
});
534534
});
535535

536-
Deno.test("FreshApp - overwrite default 404 handler", async () => {
536+
Deno.test("App - overwrite default 404 handler", async () => {
537537
const app = new App().get("/foo", () => new Response("foo"));
538538

539539
const server = new FakeServer(

0 commit comments

Comments
 (0)