Repository navigation
Angular2 testing: TestBed - #1160
Conversation
808e975 to
0e509f4
Compare
There was a problem hiding this comment.
Is this the "equivalent" to stabilization from ng1?
There was a problem hiding this comment.
In ng2 the change detection is always executed only once (vs until il stabilizes in ng1) because the cd graph is a DAG.
So yes it could be thought as the equivalent.
5ddb8b3 to
ce58fad
Compare
9912088 to
f4e973a
Compare
There was a problem hiding this comment.
In Dart 1.9+ async is a keyword. Let's not use it in variable names.
There was a problem hiding this comment.
Good point.
Added a todo in this PR, we'll rename right before merging.
There was a problem hiding this comment.
Would overriding the template this way mean we won't be able to run tests in static mode? We certainly want to be able to do this once transformers are ready. (This comments applies to other methods in this class)
There was a problem hiding this comment.
There should be no problem running tests in static mode.
A @Component could have many @Template annotations and the TemplateResolver returns the active one. The code here wraps the resolver to return an overridden Template, no matter what the underlying annotations are.
|
@yjbanov what about providing an (extra) higher level API targeted to end user ? will still need the lower level API for core tests. Agree to keep 1146 opened until then. While most features in 1146 should be doable, I still have no clue how we could implement something like FakeAsync in JS. Timers should be ok, however there is no microtask hooks in JS that would allow to microleap. /ref angular/zone.js#59, #1116 |
|
@yjbanov I've updated the design doc & added a last commit with a more end user friendly API. I would appreciate your feedback on those. I'd like to push the async tests to some further PR in order not to delay the merge of this one. We also need to discuss about the declarative API ( |
|
I didn't mean to imply that you fix the API in this request (indeed I should have LGTM'd immediately). The original goal seemed to be to simplify the testbed for Angular's own tests. I'd say in that respect mission accomplished. As for publicly facing API, the issue with exposing internal objects is not complexity but a promise of stability. We want the freedom to change Angular internals without breaking users, advanced or otherwise, and the only way to ensure that is to keep private objects private. So LGTM, and let's think more deeply what the public API should look like. |
6b7d685 to
7506680
Compare
dfb7e04 to
7f2ab25
Compare
|
@yjbanov ok. /all While this PR was working fine before the render branch was merged, it now trigger an error (JS only, Dart is fine): For some reason If any body as any clue, that would be really helpful |
|
The last commit fixes the error (but why ???) - should we go with it for now and revisit this once we switch to TS ? |
11f2e44 to
61fdae6
Compare
|
I don't think I can, I'm not in the office and honestly know squat about Traceur. Maybe @alexeagle can help? |
|
I don't know about the traceur problem either. But we do have other places where we are making temporary fixes for ts2dart and for typescript to co-exist with traceur in the short-term, so that solution is probably okay |
|
The issue was a circular dependency (compile_control -> compile_step -> compile_control), found thanks to @arv. The circular dependency is not introduced by this PR but was trigerred because the loading order of modules was changed by this PR. Anyway seems like it's gone after rebasing on latest master. If Travis is green, I'll merge this. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
todos:
async: AsyncTestCompleter