-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Use ngsummary in unit testing #8007
Conversation
create transformer replace initTestEnvironment
@@ -55,6 +55,11 @@ const TestCommand = Command.extend({ | |||
Defaults to the karma config file in .angular-cli.json.` | |||
}, | |||
{ | |||
name: 'aot', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also have to add the same field into TestOptions
interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing out, I fixed it :)
e022cce
to
14015e2
Compare
@hansl can you check how this fits into the roadmap please? |
After talking to @tbosch, AOT in unit tests is still experimental. We'll wait until it stabilizes before letting this PR in. |
@hansl Thanks for your comment. Is tbosh currently working on stabilization? If it takes time for that work, I'd like you to consider reviewing and merging. I implemented this PR's function as opt-in, and it never effect for users who do not use this option.
I also understand it. But I have been using AOT unit-test since release angular/core v4.2.1 and I have never encountered any issues about this. And CLI users can not use AOT unit testing without |
Any update on this? I'd love to be able to utilize aot unit testing now that aot compile time is much faster in 5.0 |
I apologize if this is an inappropriate place to post this, but I've been stuck with AoT and Unit testing.. I see here that unit testing with AoT isn't officially supported, but I'm having a fundamental flaw with my source code. it seems that JiT is required for unit testing and that requires component's templateurls and styleurls to be absolute. what is the best practice for templateurls and styleurls if I wish to run AoT and also karma? |
Closing this as AOT is experimental in unit tests. We are waiting for official word from the compiler team. |
Any plans on introducing AoT in unit tests? Perhaps with Ivy? |
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. |
It closes #6650 .
It allows
ng test --aot
.If
--aot
option set, transforminitTestEnvironment
to add the 3rd argumentaotSummaries
(https://angular.io/api/core/testing/TestBed#initTestEnvironment) like replacingbootstrap
method to use.ngfactory
limitation
It works only if
angularCompilerPlugin
is supported.