angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

(Feature Request) Ability to use AOT in unit testing

Open Quramy opened this issue 9 years ago • 27 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

Repro steps.

The log given by the failure.

Desired functionality.

At @angular/core/testing v4.2.0, .ngSummary.ts files are introduced to support to use AOT in unit testing ( https://github.com/angular/angular/blob/master/CHANGELOG.md#features-4 ). Do you have a milestone about this? I think it's useful to run unit testing with something like ng test --aot .

Mention any other details that might be useful.

Quramy avatar Jun 12 '17 17:06 Quramy

Yesterday, I tried to run tests in AOT + IVY and got some success for some simple tests.

I got problem with type checking in templates. I had NO_ERRORS_SCHEME but type checking was enabled for unknown components.

sharikovvladislav avatar Nov 01 '19 10:11 sharikovvladislav

I tried Karma and enableIvy: true too. And I checked out R3TestBedCompiler(not AoT but JiT) makes unit tests so faster :tada:

For now, I close this issue because my motivation, which was to improve performance of unit testing, has already achieved .

Quramy avatar Dec 04 '19 14:12 Quramy

@Quramy Which version did you try?

Goodwine avatar Dec 04 '19 19:12 Goodwine

@Goodwine


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.3.20
Node: 10.16.0
OS: darwin x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.20
@angular-devkit/build-angular     0.803.20
@angular-devkit/build-optimizer   0.803.20
@angular-devkit/build-webpack     0.803.20
@angular-devkit/core              8.3.20
@angular-devkit/schematics        8.3.20
@angular/cli                      8.3.20
@ngtools/webpack                  8.3.20
@schematics/angular               8.3.20
@schematics/update                0.803.20
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Quramy avatar Dec 04 '19 23:12 Quramy

@Quramy I couldn't find any references to R3TestBedCompiler. Can you post more info?

giggio avatar Dec 05 '19 00:12 giggio

@giggio I've commented https://github.com/angular/angular/issues/12409#issuecomment-561908267

Quramy avatar Dec 05 '19 00:12 Quramy

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.