@@ -12,13 +12,13 @@ import { BuilderMode } from '../../schema';
12
12
13
13
describeKarmaBuilder ( execute , KARMA_BUILDER_INFO , ( harness , setupTarget ) => {
14
14
describe ( 'Option: "aot"' , ( ) => {
15
- it ( 'enables aot' , async ( ) => {
15
+ it ( 'enables aot with application builder ' , async ( ) => {
16
16
await setupTarget ( harness ) ;
17
17
18
18
await harness . writeFiles ( {
19
19
'src/aot.spec.ts' : `
20
20
import { Component } from '@angular/core';
21
-
21
+
22
22
describe('Hello', () => {
23
23
it('should *not* contain jit instructions', () => {
24
24
@Component({
@@ -43,5 +43,37 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => {
43
43
const { result } = await harness . executeOnce ( ) ;
44
44
expect ( result ?. success ) . toBeTrue ( ) ;
45
45
} ) ;
46
+
47
+ it ( 'enables aot with browser builder' , async ( ) => {
48
+ await setupTarget ( harness ) ;
49
+
50
+ await harness . writeFiles ( {
51
+ 'src/aot.spec.ts' : `
52
+ import { Component } from '@angular/core';
53
+
54
+ describe('Hello', () => {
55
+ it('should *not* contain jit instructions', () => {
56
+ @Component({
57
+ template: 'Hello',
58
+ })
59
+ class Hello {}
60
+
61
+ expect((Hello as any).ɵcmp.template.toString()).not.toContain('jit');
62
+ });
63
+ });
64
+ ` ,
65
+ } ) ;
66
+
67
+ harness . useTarget ( 'test' , {
68
+ ...BASE_OPTIONS ,
69
+ aot : true ,
70
+ /** Cf. {@link ../builder-mode_spec.ts} */
71
+ polyfills : [ 'zone.js' , '@angular/localize/init' , 'zone.js/testing' ] ,
72
+ builderMode : BuilderMode . Browser ,
73
+ } ) ;
74
+
75
+ const { result } = await harness . executeOnce ( ) ;
76
+ expect ( result ?. success ) . toBeTrue ( ) ;
77
+ } ) ;
46
78
} ) ;
47
79
} ) ;
0 commit comments