yield* userApi.createUser({
name
}).pipe(
Effect.provide(
makeTestLayer(UserRepo)({
getById: () => Effect.succeed(undefined),
}),
),
// This throws an error
// Type 'NotificationRepo' is not assignable to type 'UserApi
// I need to be able to simply provide a mock of the NotificationApi
// And ignore any dependencies that it expects
Effect.provide(
makeTestLayer(NotificationApi)({
sendNotification: () => Effect.succeed("ok"),
}),
),
)
}),
// The makeTestLayer functon comes from effect-http-play: https://github.com/tim-smart/effect-http-play/blob/main/src/lib/Layer.ts
yield* userApi.createUser({
name
}).pipe(
Effect.provide(
makeTestLayer(UserRepo)({
getById: () => Effect.succeed(undefined),
}),
),
// This throws an error
// Type 'NotificationRepo' is not assignable to type 'UserApi
// I need to be able to simply provide a mock of the NotificationApi
// And ignore any dependencies that it expects
Effect.provide(
makeTestLayer(NotificationApi)({
sendNotification: () => Effect.succeed("ok"),
}),
),
)
}),
// The makeTestLayer functon comes from effect-http-play: https://github.com/tim-smart/effect-http-play/blob/main/src/lib/Layer.ts