Fishery is a library for setting up JavaScript objects as test data.
Fishery solves the problem of creating consistent, reusable test data by providing a factory pattern for generating objects. Rather than manually constructing objects in each test, developers define factories that specify default properties and behavior. The library accepts typed parameters and returns typed objects, allowing factories to be called with `build()` for synchronous object creation or `create()` for asynchronous operations like database persistence. Factories can compute derived properties based on input parameters, accept transient parameters that don't map to the result object, and manage associations between objects.
Fishery is designed for teams using TypeScript, where its type system ensures that test data matches expected shapes and that factory parameters are correctly specified. The tool suits projects where tests need consistent, maintainable fixtures or where data setup is complex enough to benefit from reusable patterns. It works without TypeScript as well, though without the type safety benefits. The library is modeled after factory_bot, a Ruby testing tool, making it familiar to developers transitioning from Ruby projects.
The project maintains active engagement with its codebase through regular updates and responsiveness to issues. Development shows consistent attention to both feature completeness and code quality, with documentation kept current alongside implementation changes.