Stream test
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { BunRuntime } from "@effect/platform-bun"
|
||||
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 { ExpressApp } from "./http/ExpressApp"
|
||||
import { ExpressHTTPServer } from "./http/ExpressHTTPServer"
|
||||
@@ -64,6 +64,20 @@ const main = Effect.gen(function*() {
|
||||
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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user