| 890 | * @since 4.0.0 |
| 891 | */ |
| 892 | export const layerTest = <I, Service, Ops extends GraphQL.Any>( |
| 893 | service: Context.Key<I, Service>, |
| 894 | group: GraphQLGroup.GraphQLGroup<Ops> & (GraphQLClient<Ops> extends NoInfer<Service> ? unknown : never) |
| 895 | ) => |
| 896 | (handlers: TestHandlers<Ops>): Layer.Layer<I> => |
| 897 | // The group constraint checks that the mock satisfies the service shape. |
| 898 | Layer.succeed(service, makeTest(group)(handlers) as unknown as Service) |
| 899 | |
| 900 | // Handlers are called through these erased signatures; `makeTest` has |
| 901 | // already checked them against the operation. |