effect-start 0.13.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/package.json +13 -14
  2. package/src/Commander.test.ts +507 -245
  3. package/src/ContentNegotiation.test.ts +500 -0
  4. package/src/ContentNegotiation.ts +535 -0
  5. package/src/FileRouter.ts +16 -12
  6. package/src/{FileRouterCodegen.test.ts → FileRouterCodegen.todo.ts} +384 -219
  7. package/src/FileRouterCodegen.ts +6 -6
  8. package/src/FileRouterPattern.test.ts +93 -62
  9. package/src/FileRouter_files.test.ts +6 -6
  10. package/src/FileRouter_path.test.ts +121 -69
  11. package/src/FileRouter_tree.test.ts +62 -56
  12. package/src/FileSystemExtra.test.ts +46 -30
  13. package/src/Http.test.ts +24 -0
  14. package/src/Http.ts +25 -0
  15. package/src/HttpAppExtra.test.ts +40 -21
  16. package/src/HttpAppExtra.ts +0 -1
  17. package/src/HttpUtils.test.ts +35 -18
  18. package/src/HttpUtils.ts +2 -0
  19. package/src/PathPattern.test.ts +648 -0
  20. package/src/PathPattern.ts +483 -0
  21. package/src/Route.ts +258 -1073
  22. package/src/RouteBody.test.ts +182 -0
  23. package/src/RouteBody.ts +106 -0
  24. package/src/RouteHook.test.ts +40 -0
  25. package/src/RouteHook.ts +105 -0
  26. package/src/RouteHttp.test.ts +443 -0
  27. package/src/RouteHttp.ts +219 -0
  28. package/src/RouteMount.test.ts +468 -0
  29. package/src/RouteMount.ts +313 -0
  30. package/src/RouteSchema.test.ts +81 -0
  31. package/src/RouteSchema.ts +44 -0
  32. package/src/RouteTree.test.ts +346 -0
  33. package/src/RouteTree.ts +165 -0
  34. package/src/RouteTrie.test.ts +322 -0
  35. package/src/RouteTrie.ts +224 -0
  36. package/src/RouterPattern.test.ts +569 -548
  37. package/src/RouterPattern.ts +7 -7
  38. package/src/Start.ts +3 -37
  39. package/src/StartApp.ts +20 -16
  40. package/src/TuplePathPattern.ts +64 -0
  41. package/src/Values.ts +16 -0
  42. package/src/bun/BunBundle.test.ts +37 -43
  43. package/src/bun/BunBundle.ts +2 -2
  44. package/src/bun/BunBundle_imports.test.ts +6 -8
  45. package/src/bun/BunHttpServer.test.ts +183 -6
  46. package/src/bun/BunHttpServer.ts +56 -32
  47. package/src/bun/BunHttpServer_web.ts +18 -6
  48. package/src/bun/BunImportTrackerPlugin.test.ts +3 -3
  49. package/src/bun/BunRoute.ts +29 -210
  50. package/src/{Bundle.ts → bundler/Bundle.ts} +0 -35
  51. package/src/{BundleHttp.test.ts → bundler/BundleHttp.test.ts} +36 -64
  52. package/src/{BundleHttp.ts → bundler/BundleHttp.ts} +1 -1
  53. package/src/client/index.ts +1 -1
  54. package/src/{Effect_HttpRouter.test.ts → effect/HttpRouter.test.ts} +69 -91
  55. package/src/{EncryptedCookies.test.ts → experimental/EncryptedCookies.test.ts} +125 -64
  56. package/src/{SseHttpResponse.ts → experimental/SseHttpResponse.ts} +1 -1
  57. package/src/experimental/index.ts +2 -0
  58. package/src/hyper/Hyper.ts +89 -0
  59. package/src/{HyperHtml.test.ts → hyper/HyperHtml.test.ts} +13 -13
  60. package/src/{HyperHtml.ts → hyper/HyperHtml.ts} +2 -2
  61. package/src/{jsx.d.ts → hyper/jsx.d.ts} +1 -1
  62. package/src/index.ts +1 -21
  63. package/src/middlewares/BasicAuthMiddleware.test.ts +29 -19
  64. package/src/middlewares/index.ts +1 -0
  65. package/src/{NodeFileSystem.ts → node/FileSystem.ts} +6 -2
  66. package/src/{TestHttpClient.test.ts → testing/TestHttpClient.test.ts} +27 -27
  67. package/src/{TestHttpClient.ts → testing/TestHttpClient.ts} +0 -1
  68. package/src/{TestLogger.test.ts → testing/TestLogger.test.ts} +27 -11
  69. package/src/testing/index.ts +3 -0
  70. package/src/x/datastar/Datastar.test.ts +47 -48
  71. package/src/x/datastar/Datastar.ts +1 -1
  72. package/src/x/tailwind/TailwindPlugin.test.ts +56 -58
  73. package/src/x/tailwind/TailwindPlugin.ts +23 -17
  74. package/src/x/tailwind/plugin.ts +1 -1
  75. package/src/FileHttpRouter.test.ts +0 -239
  76. package/src/FileHttpRouter.ts +0 -194
  77. package/src/Hyper.ts +0 -194
  78. package/src/JsModule.test.ts +0 -14
  79. package/src/JsModule.ts +0 -116
  80. package/src/PublicDirectory.test.ts +0 -280
  81. package/src/PublicDirectory.ts +0 -108
  82. package/src/Route.test.ts +0 -1370
  83. package/src/RouteRender.ts +0 -40
  84. package/src/Router.test.ts +0 -375
  85. package/src/Router.ts +0 -255
  86. package/src/StartHttp.ts +0 -42
  87. package/src/bun/BunRoute.test.ts +0 -480
  88. package/src/bun/BunRoute_bundles.test.ts +0 -219
  89. /package/src/{BundleFiles.ts → bundler/BundleFiles.ts} +0 -0
  90. /package/src/{EncryptedCookies.ts → experimental/EncryptedCookies.ts} +0 -0
  91. /package/src/{HyperNode.ts → hyper/HyperNode.ts} +0 -0
  92. /package/src/{jsx-runtime.ts → hyper/jsx-runtime.ts} +0 -0
  93. /package/src/{NodeUtils.ts → node/Utils.ts} +0 -0
  94. /package/src/{TestLogger.ts → testing/TestLogger.ts} +0 -0
  95. /package/src/{testing.ts → testing/utils.ts} +0 -0
@@ -6,7 +6,6 @@ import {
6
6
  PubSub,
7
7
  } from "effect"
8
8
  import * as Schema from "effect/Schema"
9
- import { importBlob } from "./JsModule.ts"
10
9
 
11
10
  export const BundleEntrypointMetaKey: unique symbol = Symbol.for(
12
11
  "effect-start/BundleEntrypointMetaKey",
@@ -131,37 +130,3 @@ export type Tag = Context.Tag<
131
130
 
132
131
  export class ClientBundle extends Tag("ClientBundle")<ClientBundle>() {}
133
132
  export class ServerBundle extends Tag("ServerBundle")<ServerBundle>() {}
134
-
135
- /**
136
- * Lodas a bundle as a javascript module.
137
- * Bundle must have only one entrypoint.
138
- */
139
- export function load<M>(
140
- bundle: Effect.Effect<BundleContext, BundleError>,
141
- ): Effect.Effect<M, BundleError> {
142
- return Effect.gen(function*() {
143
- const context = yield* bundle
144
- const [artifact, ...rest] = Object.values(context.entrypoints)
145
-
146
- if (rest.length > 0) {
147
- return yield* Effect.fail(
148
- new BundleError({
149
- message: "Multiple entrypoints are not supported in load()",
150
- }),
151
- )
152
- }
153
-
154
- return yield* Effect.tryPromise({
155
- try: () => {
156
- const blob = context.getArtifact(artifact)
157
-
158
- return importBlob<M>(blob!)
159
- },
160
- catch: (e) =>
161
- new BundleError({
162
- message: "Failed to load entrypoint",
163
- cause: e,
164
- }),
165
- })
166
- })
167
- }
@@ -1,16 +1,14 @@
1
1
  import * as HttpRouter from "@effect/platform/HttpRouter"
2
2
  import * as HttpServerResponse from "@effect/platform/HttpServerResponse"
3
- import * as t from "bun:test"
4
- import {
5
- Bundle,
6
- BundleHttp,
7
- effectFn,
8
- TestHttpClient,
9
- } from "effect-start"
3
+ import * as test from "bun:test"
10
4
  import * as Effect from "effect/Effect"
11
5
  import * as Layer from "effect/Layer"
12
- import IndexHtml from "../static/react-dashboard.html" with { type: "file" }
13
- import * as BunBundle from "./bun/BunBundle.ts"
6
+ import IndexHtml from "../../static/react-dashboard.html" with { type: "file" }
7
+ import * as BunBundle from "../bun/BunBundle.ts"
8
+ import { effectFn } from "../testing"
9
+ import * as TestHttpClient from "../testing/TestHttpClient.ts"
10
+ import * as Bundle from "./Bundle.ts"
11
+ import * as BundleHttp from "./BundleHttp.ts"
14
12
 
15
13
  const effect = effectFn(
16
14
  Layer.effect(
@@ -19,7 +17,7 @@ const effect = effectFn(
19
17
  ),
20
18
  )
21
19
 
22
- t.it("entrypoint with specific uri", () =>
20
+ test.it("entrypoint with specific uri", () =>
23
21
  effect(function*() {
24
22
  const App = HttpRouter.empty.pipe(
25
23
  HttpRouter.get(
@@ -30,19 +28,15 @@ t.it("entrypoint with specific uri", () =>
30
28
  const Client = TestHttpClient.make(App)
31
29
 
32
30
  const dashboardRes = yield* Client.get("/react-dashboard")
33
- t
34
- .expect(
35
- dashboardRes.status,
36
- )
31
+ test
32
+ .expect(dashboardRes.status)
37
33
  .toBe(200)
38
- t
39
- .expect(
40
- yield* dashboardRes.text,
41
- )
34
+ test
35
+ .expect(yield* dashboardRes.text)
42
36
  .toStartWith("<!DOCTYPE html>")
43
37
  }))
44
38
 
45
- t.it("entrypoint without uri parameter", () =>
39
+ test.it("entrypoint without uri parameter", () =>
46
40
  effect(function*() {
47
41
  const App = HttpRouter.empty.pipe(
48
42
  HttpRouter.get(
@@ -70,10 +64,8 @@ t.it("entrypoint without uri parameter", () =>
70
64
  () => HttpServerResponse.empty({ status: 404 }),
71
65
  ),
72
66
  )
73
- t
74
- .expect(
75
- indexRes.status,
76
- )
67
+ test
68
+ .expect(indexRes.status)
77
69
  .toBe(404)
78
70
 
79
71
  const indexPathRes = yield* Client.get("/index").pipe(
@@ -82,22 +74,16 @@ t.it("entrypoint without uri parameter", () =>
82
74
  () => HttpServerResponse.empty({ status: 404 }),
83
75
  ),
84
76
  )
85
- t
86
- .expect(
87
- indexPathRes.status,
88
- )
77
+ test
78
+ .expect(indexPathRes.status)
89
79
  .toBe(404)
90
80
 
91
81
  const dashboardRes = yield* Client.get("/react-dashboard")
92
- t
93
- .expect(
94
- dashboardRes.status,
95
- )
82
+ test
83
+ .expect(dashboardRes.status)
96
84
  .toBe(200)
97
- t
98
- .expect(
99
- yield* dashboardRes.text,
100
- )
85
+ test
86
+ .expect(yield* dashboardRes.text)
101
87
  .toStartWith("<!DOCTYPE html>")
102
88
 
103
89
  const nonexistentRes = yield* Client.get("/nonexistent").pipe(
@@ -106,14 +92,12 @@ t.it("entrypoint without uri parameter", () =>
106
92
  () => HttpServerResponse.empty({ status: 404 }),
107
93
  ),
108
94
  )
109
- t
110
- .expect(
111
- nonexistentRes.status,
112
- )
95
+ test
96
+ .expect(nonexistentRes.status)
113
97
  .toBe(404)
114
98
  }))
115
99
 
116
- t.it("withEntrypoints middleware", () =>
100
+ test.it("withEntrypoints middleware", () =>
117
101
  effect(function*() {
118
102
  const fallbackApp = Effect.succeed(
119
103
  HttpServerResponse.text("Fallback", { status: 404 }),
@@ -123,38 +107,26 @@ t.it("withEntrypoints middleware", () =>
123
107
  const Client = TestHttpClient.make(App)
124
108
 
125
109
  const rootRes = yield* Client.get("/")
126
- t
127
- .expect(
128
- rootRes.status,
129
- )
110
+ test
111
+ .expect(rootRes.status)
130
112
  .toBe(404)
131
- t
132
- .expect(
133
- yield* rootRes.text,
134
- )
113
+ test
114
+ .expect(yield* rootRes.text)
135
115
  .toBe("Fallback")
136
116
 
137
117
  const dashboardRes = yield* Client.get("/react-dashboard")
138
- t
139
- .expect(
140
- dashboardRes.status,
141
- )
118
+ test
119
+ .expect(dashboardRes.status)
142
120
  .toBe(200)
143
- t
144
- .expect(
145
- yield* dashboardRes.text,
146
- )
121
+ test
122
+ .expect(yield* dashboardRes.text)
147
123
  .toStartWith("<!DOCTYPE html>")
148
124
 
149
125
  const nonexistentRes = yield* Client.get("/nonexistent")
150
- t
151
- .expect(
152
- nonexistentRes.status,
153
- )
126
+ test
127
+ .expect(nonexistentRes.status)
154
128
  .toBe(404)
155
- t
156
- .expect(
157
- yield* nonexistentRes.text,
158
- )
129
+ test
130
+ .expect(yield* nonexistentRes.text)
159
131
  .toBe("Fallback")
160
132
  }))
@@ -12,8 +12,8 @@ import * as Scope from "effect/Scope"
12
12
  import * as Stream from "effect/Stream"
13
13
  import * as NPath from "node:path"
14
14
  import * as NUrl from "node:url"
15
+ import * as SseHttpResponse from "../experimental/SseHttpResponse.ts"
15
16
  import * as Bundle from "./Bundle.ts"
16
- import * as SseHttpResponse from "./SseHttpResponse.ts"
17
17
 
18
18
  const DefaultBundleEndpoint = "/_bundle"
19
19
 
@@ -10,7 +10,7 @@
10
10
  import type {
11
11
  BundleEvent,
12
12
  BundleManifest,
13
- } from "../Bundle.ts"
13
+ } from "../bundler/Bundle.ts"
14
14
  import { showBuildError } from "./Overlay.ts"
15
15
  import * as ScrollState from "./ScrollState.ts"
16
16
 
@@ -1,19 +1,20 @@
1
1
  /**
2
2
  * This file tests `@effect/platform/HttpRouter`, not our code.
3
3
  * Since Platform code is still unstable and we relay heavily on its
4
- * chaining/fallback behavior in `BundleHttp` & `FileHttpRouter`.
4
+ * chaining/fallback behavior in `BundleHttp`
5
5
  * We want to ensure the behavior doesn't change across versions.
6
6
  */
7
7
  import * as HttpRouter from "@effect/platform/HttpRouter"
8
8
  import * as HttpServerResponse from "@effect/platform/HttpServerResponse"
9
- import * as t from "bun:test"
10
- import * as Effect from "effect/Effect"
11
- import * as TestHttpClient from "../src/TestHttpClient.ts"
12
- import { effectFn } from "../src/testing.ts"
9
+ import * as test from "bun:test"
10
+ import {
11
+ effectFn,
12
+ TestHttpClient,
13
+ } from "../testing"
13
14
 
14
15
  const effect = effectFn()
15
16
 
16
- t.it("Single app mounted on path", () =>
17
+ test.it("Single app mounted on path", () =>
17
18
  effect(function*() {
18
19
  const app1 = HttpRouter.empty.pipe(
19
20
  HttpRouter.get("/hello", HttpServerResponse.text("Hello from app1")),
@@ -26,16 +27,15 @@ t.it("Single app mounted on path", () =>
26
27
  const client = TestHttpClient.make(router)
27
28
  const response = yield* client.get("/api/hello")
28
29
 
29
- t
30
+ test
30
31
  .expect(response.status)
31
32
  .toBe(200)
32
-
33
- t
33
+ test
34
34
  .expect(yield* response.text)
35
35
  .toBe("Hello from app1")
36
36
  }))
37
37
 
38
- t.it(
38
+ test.it(
39
39
  "Multiple apps mounted on same path chain together",
40
40
  () =>
41
41
  effect(function*() {
@@ -56,27 +56,25 @@ t.it(
56
56
 
57
57
  const response1 = yield* client.get("/api/hello")
58
58
 
59
- t
59
+ test
60
60
  .expect(response1.status)
61
61
  .toBe(200)
62
-
63
- t
62
+ test
64
63
  .expect(yield* response1.text)
65
64
  .toBe("Hello from app1")
66
65
 
67
66
  const response2 = yield* client.get("/api/world")
68
67
 
69
- t
68
+ test
70
69
  .expect(response2.status)
71
70
  .toBe(200)
72
-
73
- t
71
+ test
74
72
  .expect(yield* response2.text)
75
73
  .toBe("World from app2")
76
74
  }),
77
75
  )
78
76
 
79
- t.it(
77
+ test.it(
80
78
  "First app has no matching route - second app should be called",
81
79
  () =>
82
80
  effect(function*() {
@@ -96,17 +94,16 @@ t.it(
96
94
  const client = TestHttpClient.make(router)
97
95
  const response = yield* client.get("/api/missing")
98
96
 
99
- t
97
+ test
100
98
  .expect(response.status)
101
99
  .toBe(200)
102
-
103
- t
100
+ test
104
101
  .expect(yield* response.text)
105
102
  .toBe("Found in app2")
106
103
  }),
107
104
  )
108
105
 
109
- t.it(
106
+ test.it(
110
107
  "First app has no matching route - second app should be called",
111
108
  () =>
112
109
  effect(function*() {
@@ -129,17 +126,16 @@ t.it(
129
126
  const client = TestHttpClient.make(router)
130
127
  const response = yield* client.get("/api/different")
131
128
 
132
- t
129
+ test
133
130
  .expect(response.status)
134
131
  .toBe(200)
135
-
136
- t
132
+ test
137
133
  .expect(yield* response.text)
138
134
  .toBe("Different route")
139
135
  }),
140
136
  )
141
137
 
142
- t.it("Multiple mounts with different methods", () =>
138
+ test.it("Multiple mounts with different methods", () =>
143
139
  effect(function*() {
144
140
  const app1 = HttpRouter.empty.pipe(
145
141
  HttpRouter.get("/data", HttpServerResponse.text("GET data")),
@@ -158,26 +154,24 @@ t.it("Multiple mounts with different methods", () =>
158
154
 
159
155
  const getResponse = yield* client.get("/api/data")
160
156
 
161
- t
157
+ test
162
158
  .expect(getResponse.status)
163
159
  .toBe(200)
164
-
165
- t
160
+ test
166
161
  .expect(yield* getResponse.text)
167
162
  .toBe("GET data")
168
163
 
169
164
  const postResponse = yield* client.post("/api/data")
170
165
 
171
- t
166
+ test
172
167
  .expect(postResponse.status)
173
168
  .toBe(200)
174
-
175
- t
169
+ test
176
170
  .expect(yield* postResponse.text)
177
171
  .toBe("POST data")
178
172
  }))
179
173
 
180
- t.it(
174
+ test.it(
181
175
  "Route chaining: RouteNotFound error chains to next router (root mount)",
182
176
  () =>
183
177
  effect(function*() {
@@ -203,17 +197,16 @@ t.it(
203
197
  const client = TestHttpClient.make(router)
204
198
  const response = yield* client.get("/admin/page")
205
199
 
206
- t
200
+ test
207
201
  .expect(response.status)
208
202
  .toBe(200)
209
-
210
- t
203
+ test
211
204
  .expect(yield* response.text)
212
205
  .toBe("Page from subApp2")
213
206
  }),
214
207
  )
215
208
 
216
- t.it(
209
+ test.it(
217
210
  "Route chaining: explicit 404 response does not chain to next router (root mount)",
218
211
  () =>
219
212
  effect(function*() {
@@ -239,17 +232,16 @@ t.it(
239
232
  const client = TestHttpClient.make(router)
240
233
  const response = yield* client.get("/admin/page")
241
234
 
242
- t
235
+ test
243
236
  .expect(response.status)
244
237
  .toBe(404)
245
-
246
- t
238
+ test
247
239
  .expect(yield* response.text)
248
240
  .toBe("")
249
241
  }),
250
242
  )
251
243
 
252
- t.it(
244
+ test.it(
253
245
  "Route conflicts: direct handlers win when defined before root mount",
254
246
  () =>
255
247
  effect(function*() {
@@ -280,37 +272,34 @@ t.it(
280
272
 
281
273
  const settingsResponse = yield* client.get("/admin/settings")
282
274
 
283
- t
275
+ test
284
276
  .expect(settingsResponse.status)
285
277
  .toBe(200)
286
-
287
- t
278
+ test
288
279
  .expect(yield* settingsResponse.text)
289
280
  .toBe("Settings from direct handler")
290
281
 
291
282
  const usersResponse = yield* client.get("/admin/users")
292
283
 
293
- t
284
+ test
294
285
  .expect(usersResponse.status)
295
286
  .toBe(200)
296
-
297
- t
287
+ test
298
288
  .expect(yield* usersResponse.text)
299
289
  .toBe("Users from direct handler")
300
290
 
301
291
  const dashboardResponse = yield* client.get("/admin/dashboard")
302
292
 
303
- t
293
+ test
304
294
  .expect(dashboardResponse.status)
305
295
  .toBe(200)
306
-
307
- t
296
+ test
308
297
  .expect(yield* dashboardResponse.text)
309
298
  .toBe("Dashboard from subApp")
310
299
  }),
311
300
  )
312
301
 
313
- t.it(
302
+ test.it(
314
303
  "Route conflicts: root mount wins when defined before direct handlers",
315
304
  () =>
316
305
  effect(function*() {
@@ -341,37 +330,34 @@ t.it(
341
330
 
342
331
  const profileResponse = yield* client.get("/admin/profile")
343
332
 
344
- t
333
+ test
345
334
  .expect(profileResponse.status)
346
335
  .toBe(200)
347
-
348
- t
336
+ test
349
337
  .expect(yield* profileResponse.text)
350
338
  .toBe("Profile from subApp")
351
339
 
352
340
  const usersResponse = yield* client.get("/admin/users")
353
341
 
354
- t
342
+ test
355
343
  .expect(usersResponse.status)
356
344
  .toBe(200)
357
-
358
- t
345
+ test
359
346
  .expect(yield* usersResponse.text)
360
347
  .toBe("Users from direct handler")
361
348
 
362
349
  const dashboardResponse = yield* client.get("/admin/dashboard")
363
350
 
364
- t
351
+ test
365
352
  .expect(dashboardResponse.status)
366
353
  .toBe(200)
367
-
368
- t
354
+ test
369
355
  .expect(yield* dashboardResponse.text)
370
356
  .toBe("Dashboard from subApp")
371
357
  }),
372
358
  )
373
359
 
374
- t.it(
360
+ test.it(
375
361
  "Route conflicts: mountApp does not chain with direct handlers defined before",
376
362
  () =>
377
363
  effect(function*() {
@@ -402,29 +388,28 @@ t.it(
402
388
 
403
389
  const settingsResponse = yield* client.get("/admin/settings")
404
390
 
405
- t
391
+ test
406
392
  .expect(settingsResponse.status)
407
393
  .toBe(404)
408
394
 
409
395
  const usersResponse = yield* client.get("/admin/users")
410
396
 
411
- t
397
+ test
412
398
  .expect(usersResponse.status)
413
399
  .toBe(404)
414
400
 
415
401
  const dashboardResponse = yield* client.get("/admin/dashboard")
416
402
 
417
- t
403
+ test
418
404
  .expect(dashboardResponse.status)
419
405
  .toBe(200)
420
-
421
- t
406
+ test
422
407
  .expect(yield* dashboardResponse.text)
423
408
  .toBe("Dashboard from subApp")
424
409
  }),
425
410
  )
426
411
 
427
- t.it(
412
+ test.it(
428
413
  "Route conflicts: mountApp does not chain with direct handlers defined after",
429
414
  () =>
430
415
  effect(function*() {
@@ -455,33 +440,31 @@ t.it(
455
440
 
456
441
  const profileResponse = yield* client.get("/admin/profile")
457
442
 
458
- t
443
+ test
459
444
  .expect(profileResponse.status)
460
445
  .toBe(200)
461
-
462
- t
446
+ test
463
447
  .expect(yield* profileResponse.text)
464
448
  .toBe("Profile from subApp")
465
449
 
466
450
  const settingsResponse = yield* client.get("/admin/settings")
467
451
 
468
- t
452
+ test
469
453
  .expect(settingsResponse.status)
470
454
  .toBe(404)
471
455
 
472
456
  const dashboardResponse = yield* client.get("/admin/dashboard")
473
457
 
474
- t
458
+ test
475
459
  .expect(dashboardResponse.status)
476
460
  .toBe(200)
477
-
478
- t
461
+ test
479
462
  .expect(yield* dashboardResponse.text)
480
463
  .toBe("Dashboard from subApp")
481
464
  }),
482
465
  )
483
466
 
484
- t.it(
467
+ test.it(
485
468
  "Wildcard routes: single asterisk wildcard handler",
486
469
  () =>
487
470
  effect(function*() {
@@ -493,17 +476,16 @@ t.it(
493
476
 
494
477
  const response = yield* client.get("/anything")
495
478
 
496
- t
479
+ test
497
480
  .expect(response.status)
498
481
  .toBe(200)
499
-
500
- t
482
+ test
501
483
  .expect(yield* response.text)
502
484
  .toBe("Wildcard handler")
503
485
  }),
504
486
  )
505
487
 
506
- t.it(
488
+ test.it(
507
489
  "Wildcard routes: wildcard defined before literal route",
508
490
  () =>
509
491
  effect(function*() {
@@ -516,27 +498,25 @@ t.it(
516
498
 
517
499
  const wildcardResponse = yield* client.get("/anything")
518
500
 
519
- t
501
+ test
520
502
  .expect(wildcardResponse.status)
521
503
  .toBe(200)
522
-
523
- t
504
+ test
524
505
  .expect(yield* wildcardResponse.text)
525
506
  .toBe("Wildcard handler")
526
507
 
527
508
  const literalResponse = yield* client.get("/specific")
528
509
 
529
- t
510
+ test
530
511
  .expect(literalResponse.status)
531
512
  .toBe(200)
532
-
533
- t
513
+ test
534
514
  .expect(yield* literalResponse.text)
535
515
  .toBe("Literal handler")
536
516
  }),
537
517
  )
538
518
 
539
- t.it(
519
+ test.it(
540
520
  "Wildcard routes: literal route defined before wildcard",
541
521
  () =>
542
522
  effect(function*() {
@@ -549,21 +529,19 @@ t.it(
549
529
 
550
530
  const literalResponse = yield* client.get("/specific")
551
531
 
552
- t
532
+ test
553
533
  .expect(literalResponse.status)
554
534
  .toBe(200)
555
-
556
- t
535
+ test
557
536
  .expect(yield* literalResponse.text)
558
537
  .toBe("Literal handler")
559
538
 
560
539
  const wildcardResponse = yield* client.get("/anything")
561
540
 
562
- t
541
+ test
563
542
  .expect(wildcardResponse.status)
564
543
  .toBe(200)
565
-
566
- t
544
+ test
567
545
  .expect(yield* wildcardResponse.text)
568
546
  .toBe("Wildcard handler")
569
547
  }),