Components: add @angular/cdk/testing in the released package

Created on 23 Jan 2018  路  7Comments  路  Source: angular/components

Bug, feature request, or proposal:

request

What is the expected behavior?

There are many useful test utils in @angular/cdk/testing, and we want to use them in our project.
please add @angular/cdk/testing in the the released package, thanks!

What is the current behavior?

there is no @angular/cdk/testing in the released package

What are the steps to reproduce?

Providing a StackBlitz/Plunker (or similar) is the best way to get the team to see your issue.

Plunker starter (using on @master): https://goo.gl/uDmqyY

StackBlitz starter (using latest npm release): https://goo.gl/wwnhMV

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Is there anything else we should know?

Most helpful comment

Again, how can we test CDK-based components properly if the testing infrastructure that you've found necessary to test your own components isn't made public?

Are we just supposed to copy and paste everything from the CDK? How it that better than just including this code in the release? I don't care about a fully fledged subpackage with tests, documentation, and polished APIs.

All 7 comments

I remember reading that they intend to eventually, but want to be careful about exposing anything too soon, because anything exposed in the release has to fall under semver.

I'm just here to support this request. I find testing hard and look at the source of @angular/material for inspiration. These tests use @angular/cdk/testing and I would like the same functionality.

See https://github.com/angular/material2/issues/5803#issuecomment-323211124

Someday will will spend some time to build out some real, public-facing test utilities, but today it's just a grab-bag of random stuff we needed to test out own components. We're not ready to support what's there as a public API.

@jelbourn I don't understand. I thought the CDK was a development kit intended to enable creation of our own components? How can we test those components properly if the testing infrastructure that you require to test your own components isn't made public?

E.g the CDK provides a FocusMonitor service for managing focus, and all the focus related tests in the CDK rely on a patchElementFocus helper method to work properly. If you can't test your components focus-handling capabilities without this, then how can anybody else hope to?

Unless your argument is that testing of components is unnecessary, then aren't these helper methods just as vital to CDK end-users as the actual services they help test?

Like I said, it's something we definitely want to do, but nobody has had the resources yet to turn this into a fully fledged subpackage with tests, documentation, and polished APIs.

Again, how can we test CDK-based components properly if the testing infrastructure that you've found necessary to test your own components isn't made public?

Are we just supposed to copy and paste everything from the CDK? How it that better than just including this code in the release? I don't care about a fully fledged subpackage with tests, documentation, and polished APIs.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dzrust picture dzrust  路  3Comments

constantinlucian picture constantinlucian  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments

MurhafSousli picture MurhafSousli  路  3Comments

theunreal picture theunreal  路  3Comments