-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 0.9.10 unit test fail #52
Comments
I will check this out tomorrow. Cheers, On 21 March 2014 12:42, Günter Zöchbauer [email protected] wrote:
|
I failed miserably locating the bug. The exception is thrown after the tests are finished. I have no idea how to debug this. The mirrors library where the exception is thrown is also hard to debug (at some positions it is not possible to set breakpoints) and some relevant fields (like What I found out is, that the error changes when the templates (of the test and the alert component are modified, so that they contain no space at the beginning and between tags (only Elements, no TextNodes in HTML)
before that change it was
this seems to be caused by TextNodes in the templates (I would say this is an Angular bug) Time for bed ... |
@akserg Did you find time to take a look? |
From @akserg s comment on #53 I learned that I'm not the only one seeing this issue. I'll ask some of the AngularDart guys if they have any idea. |
One thing I have to check before is the jasmine unit test code. |
No one component works in web example. I found a lot of _RangeError_s and type RangeError: 1
On 28 March 2014 08:28, Günter Zöchbauer [email protected] wrote:
|
We took files _spec.dart and jasmine_syntax.dart from Angular Dart but On 28 March 2014 08:47, Sergey Akopkokhyants [email protected] wrote:
|
'Text' is not a subtype of type 'Element' of 'element' was one of the errors I got. What do you mean by refactoring? |
Our tests were written by different people following different patterns to On 28 March 2014 09:43, Günter Zöchbauer [email protected] wrote:
|
'Text' is not a subtype of type 'Element' .... uhm... it reminds me something. I had this issue time ago in some unit tests. If I'm not wrong, it was related to the fact that a node in the test html was a simple string without html tags. E.g. 'html content' instead of |
That issue happens in all web examples. On 28 March 2014 11:02, Francesco [email protected] wrote:
|
There aren't many other AngularDart components to learn from how to write good unit tests. I saw the microLeap for example somewhere in AngularDart tests I don't remember if the test did or didn't run without it (I don't even know if I wrote the test you refer to). Currently there seems to be some refactoring/change going on in the AngularDart project about unit test related code. What I found weird is the use of
instead of
I think the tests should be organized in a way that it is possible to executed just the tests for one component. |
"If it was for me, I wouldn't need the jasmine syntax." -> I agree. |
The matchers of Darts unittest library do the same, don't they. Just a little different syntax. expect(..., equals(...)) or expect(..., isNull) |
Set of "handy methods" help us migrate test from "Angular UI" to "Angular On 28 March 2014 19:22, Günter Zöchbauer [email protected] wrote:
|
I don't say that this was a wrong decision. I still think it was the right thing to do at the time. What I have seen from AngularDart issues is that they are refactoring this test related code to split AngularDart test utility methods and classes from Jasmine syntax code. But for me the conclusion was that Jasmine makes more troubles than it's worth. |
Global functions, you called toBeXxx, are parts of Angular's spec file and On 29 March 2014 18:56, Günter Zöchbauer [email protected] wrote:
|
They just call other functions, this is why I wonder if we need this, |
We have to wait until the changes have landed in a release anyway and then we could verify if it makes sense. |
Just a shot in the dark - but could this be related: Calls scope.$apply() - which has been renamed scope.apply() in the latest angular. Perhaps there are a few of the $xxxx methods that need to be renamed. |
Thanks Warren. :) On 31 March 2014 23:51, Warren Strange [email protected] wrote:
|
I have raised bug in Angular Dart. Directive 'ng-include' works incorrect if html template has comments. So simple removing comments from all examples does help to fix the problem. I'm still checking and fixing problem with unittests. |
I upgraded to Angular from github repo (master) and solved all errors the analyzer showed, but now every test fails (have yet to investigate) |
I have committed code, all tests passed, published. Regards, On 1 April 2014 14:30, Günter Zöchbauer [email protected] wrote:
|
Fixed. |
Great! |
I tried to check the status and saw that with Angular 0.9.10 several tests fail.
This seems to be more a problem with the test framework than with incompatibilities of AngularDart 0.9.10 and the UI elements implementation.
I started investigating alerts tests:
alert_test.dart contains two tests.
(I commented out all other tests in ui_tests.dart).
When I run those tests I get an exception/stack trace at the end.
When I comment out one of them and run only the lasting one the test succeeds.
I just wanted to share if anyone else is investigating...
I keep you updated about my progress.
The text was updated successfully, but these errors were encountered: