@@ -26,7 +26,7 @@ describe('Browser Builder with differential loading', () => {
26
26
27
27
afterEach ( async ( ) => host . restore ( ) . toPromise ( ) ) ;
28
28
29
- it ( 'emits all the neccessary files' , async ( ) => {
29
+ it ( 'emits all the neccessary files for default configuration ' , async ( ) => {
30
30
const { files } = await browserBuild ( architect , host , target ) ;
31
31
32
32
const expectedOutputs = [
@@ -62,6 +62,48 @@ describe('Browser Builder with differential loading', () => {
62
62
expect ( Object . keys ( files ) ) . toEqual ( jasmine . arrayWithExactContents ( expectedOutputs ) ) ;
63
63
} ) ;
64
64
65
+ it ( 'emits all the neccessary files for target of ES2016' , async ( ) => {
66
+ host . replaceInFile (
67
+ 'tsconfig.json' ,
68
+ '"target": "es2015",' ,
69
+ `"target": "es2016",` ,
70
+ ) ;
71
+
72
+ const { files } = await browserBuild ( architect , host , target ) ;
73
+
74
+ const expectedOutputs = [
75
+ 'favicon.ico' ,
76
+ 'index.html' ,
77
+
78
+ 'main-es2016.js' ,
79
+ 'main-es2016.js.map' ,
80
+ 'main-es5.js' ,
81
+ 'main-es5.js.map' ,
82
+
83
+ 'polyfills-es2016.js' ,
84
+ 'polyfills-es2016.js.map' ,
85
+ 'polyfills-es5.js' ,
86
+ 'polyfills-es5.js.map' ,
87
+
88
+ 'runtime-es2016.js' ,
89
+ 'runtime-es2016.js.map' ,
90
+ 'runtime-es5.js' ,
91
+ 'runtime-es5.js.map' ,
92
+
93
+ 'styles-es2016.js' ,
94
+ 'styles-es2016.js.map' ,
95
+ 'styles-es5.js' ,
96
+ 'styles-es5.js.map' ,
97
+
98
+ 'vendor-es2016.js' ,
99
+ 'vendor-es2016.js.map' ,
100
+ 'vendor-es5.js' ,
101
+ 'vendor-es5.js.map' ,
102
+ ] as PathFragment [ ] ;
103
+
104
+ expect ( Object . keys ( files ) ) . toEqual ( jasmine . arrayWithExactContents ( expectedOutputs ) ) ;
105
+ } ) ;
106
+
65
107
it ( 'deactivates differential loading for watch mode' , async ( ) => {
66
108
const { files } = await browserBuild ( architect , host , target , { watch : true } ) ;
67
109
@@ -89,14 +131,12 @@ describe('Browser Builder with differential loading', () => {
89
131
} ) ;
90
132
91
133
it ( 'emits the right ES formats' , async ( ) => {
92
- if ( ! process . env [ 'NG_BUILD_FULL_DIFFERENTIAL' ] ) {
93
- // The test fails depending on the order of previously executed tests
94
- // The wrong data is being read from the filesystem.
95
- pending ( 'Incredibly flaky outside full build differential loading' ) ;
96
- }
97
- const { files } = await browserBuild ( architect , host , target , { optimization : true } ) ;
98
- expect ( await files [ 'main-es5.js' ] ) . not . toContain ( 'class' ) ;
99
- expect ( await files [ 'main-es2015.js' ] ) . toContain ( 'class' ) ;
134
+ const { files } = await browserBuild ( architect , host , target , {
135
+ optimization : true ,
136
+ vendorChunk : false ,
137
+ } ) ;
138
+ expect ( await files [ 'main-es5.js' ] ) . not . toContain ( 'const ' ) ;
139
+ expect ( await files [ 'main-es2015.js' ] ) . toContain ( 'const ' ) ;
100
140
} ) ;
101
141
102
142
it ( 'uses the right zone.js variant' , async ( ) => {
0 commit comments