As I wrote about quite some time ago in this blog post, which details my solution for managing transitive dependencies for Angular unit tests . although Angular applications in general are easily testable and unit tests are first-class citizens with the framework itself, there’s still some potential for improvement when in it comes to test maintainability.
In particular, listing and referencing an Angular component’s dependencies (i.e. the dependencies of the system under test) such as providers or imported modules can become tedious and repetitive, which makes the resulting test code inherently less maintainable.
SCuri (an acronym standing for Spec Create Update Read (class – component, service, directive and dependencies) Incorporate (them in the spec generated/updated)) is a tool that solves a similar problem, albeit in a slightly different fashion than my solution for resolving transitive test dependencies:
Instead of maintaining test dependencies in each of the relevant test suites and resolving those transitively, in generating specs for you and helping you update those in case dependencies have been added, removed, or modified, SCuri takes a different approach:
When running the tool’s
ng g scuri:spec for a particular Angular component, SCuri will automatically resolve that component’s dependencies and automatically populate the generated unit test spec accordingly.
By using the
--update flag, SCuri allows you to have existing specs updated if the dependencies of the system under test in question have been changed.