Stream test

This commit is contained in:
Julien Valverdé
2024-07-12 03:16:50 +02:00
parent 574f0b28a6
commit a9864d6851

View File

@@ -1,6 +1,6 @@
import { BunRuntime } from "@effect/platform-bun" import { BunRuntime } from "@effect/platform-bun"
import { Todo } from "@todo-tests/common/data" import { Todo } from "@todo-tests/common/data"
import { Effect, Layer, Option } from "effect" import { Duration, Effect, Layer, Option } from "effect"
import { Services } from "./Services" import { Services } from "./Services"
import { ExpressApp } from "./http/ExpressApp" import { ExpressApp } from "./http/ExpressApp"
import { ExpressHTTPServer } from "./http/ExpressHTTPServer" import { ExpressHTTPServer } from "./http/ExpressHTTPServer"
@@ -64,6 +64,20 @@ const main = Effect.gen(function*() {
updatedAt: new Date(), updatedAt: new Date(),
})) }))
yield* Effect.fork(
todos.add(new Todo({
id: Option.none(),
order: 1,
content: "Clean the pool",
due: Option.none(),
completed: false,
createdAt: new Date(),
updatedAt: new Date(),
})).pipe(
Effect.delay(Duration.seconds(5))
)
)
yield* Layer.launch(ServerDev) yield* Layer.launch(ServerDev)
}) })