Hey there,

A bit of context: I'm trying to write a test for a component that requires 
an injected ApplicationRef. Without specifying any providers, the test 
injector solves the dependencies by trying to initialize a PlatformRef, 
which throws the following exception: (I am using RC4, and angular-cli 
which uses jasmine and karma for testing)

ERROR: Platforms have to be created via `createPlatform`
>

The solution would be to provide MockApplicationRef, for which I can't seem 
to find the module to import from. I created my own copy-pasta 
implementation from @angular/core/testing/mock_application_ref.ts 
<https://github.com/angular/angular/blob/2.0.0-rc.4/modules/%40angular/core/testing/mock_application_ref.ts>,
 
and it fixed the issue. However, it would be much DRY-er if I can simply 
import it from the core testing library.

So my question is "where is the module from which I can import 
MockApplicationRef from?" And if it is hidden from the user on purpose, 
"why is that the case?"

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to