Page Contents

Home > @loopback/repository-tests

repository-tests package

A test suite verifying functionality of @loopback/repository in a connector -independent way.

Remarks

Test-suite factories to define standardized test suite capable of testing any combination of a Repository class and a corresponding connector, for example DefaultCrudRepository with connectors like memory, MySQL and MongoDB.

Functions

Function Description
crudRepositoryTestSuite(dataSourceOptions, repositoryClass, partialFeatures)  

Interfaces

Interface Description
CrudFeatures List of flags describing behavior specific to different connectors and repository implementations. These flags are used by the test suite to tweak assertions and skip tests for scenarios not supported by some implementations.

Type Aliases

Type Alias Description
CrudRepositoryCtor A constructor of a class implementing CrudRepository interface, accepting the Entity class (constructor) and a dataSource instance.
DataSourceOptions DataSource configuration (connector name, connection string, etc.).
TransactionalRepositoryCtor A constructor of a class implementing TransactionalRepository interface, accepting the Entity class (constructor) and a dataSource instance.