Effect’s testing story
What is the recommended way to test Effect programs?
Concepts like “FooLayerLive” vs. “FooLayerTest” appear throughout documentation and examples. The core library and Schema are deeply integrated with fast check, a generative testing library that allows generation of data satisfying arbitrary predicates or type definitions. Effect code is highly composable, allowing for easy refactoring that easy testability may require.
That said, testing is a point where documentation is somewhat absent.
How to streamline the creation of test-specific code like mocks and spies with minimal effort? Should every service come with a mocked version? Is there an easy way to derive the required boilerplate? Should inputs and outputs to services be defined with Schema to enable easy arbitrary generation?
To what extent should effect libraries further cater or speak to testing use cases? For example, testing an ai program that uses effect-ai? Users may need to construct mock that allows assertions on what a model service was called with and construct the possible output types from a model call, as well as many possible error types.
In general, what is effect’s view on testing? What conveniences and patterns does it recommend to users to empower them to write good assertion-based tests for their programs?
Concepts like “FooLayerLive” vs. “FooLayerTest” appear throughout documentation and examples. The core library and Schema are deeply integrated with fast check, a generative testing library that allows generation of data satisfying arbitrary predicates or type definitions. Effect code is highly composable, allowing for easy refactoring that easy testability may require.
That said, testing is a point where documentation is somewhat absent.
How to streamline the creation of test-specific code like mocks and spies with minimal effort? Should every service come with a mocked version? Is there an easy way to derive the required boilerplate? Should inputs and outputs to services be defined with Schema to enable easy arbitrary generation?
To what extent should effect libraries further cater or speak to testing use cases? For example, testing an ai program that uses effect-ai? Users may need to construct mock that allows assertions on what a model service was called with and construct the possible output types from a model call, as well as many possible error types.
In general, what is effect’s view on testing? What conveniences and patterns does it recommend to users to empower them to write good assertion-based tests for their programs?
