@@ -42,6 +42,34 @@ import 'web-animations-js'; // Run \`npm install --save web-animations-js\`.
42
42
import 'zone.js/dist/zone'; // Included with Angular CLI.
43
43
` ;
44
44
45
+ const newPolyfills = `
46
+ /** IE9, IE10 and IE11 requires all of the following polyfills. **/
47
+ // import 'core-js/es6/symbol';
48
+ // import 'core-js/es6/object';
49
+ import 'core-js/es6/function';
50
+ import 'core-js/es6/parse-int';
51
+ // import 'core-js/es6/parse-float';
52
+ import 'core-js/es6/number';
53
+ // import 'core-js/es6/math';
54
+ // import 'core-js/es6/string';
55
+ import 'core-js/es6/date';
56
+ // import 'core-js/es6/array';
57
+ // import 'core-js/es6/regexp';
58
+
59
+ /** IE10 and IE11 requires the following for the Reflect API. */
60
+ import 'core-js/es6/reflect';
61
+
62
+ import 'web-animations-js'; // Run \`npm install --save web-animations-js\`.
63
+
64
+ (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
65
+ (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
66
+
67
+ /***************************************************************************************************
68
+ * Zone JS is required by default for Angular itself.
69
+ */
70
+ import 'zone.js/dist/zone'; // Included with Angular CLI.
71
+ ` ;
72
+
45
73
46
74
describe ( 'polyfillMetadataRule' , ( ) => {
47
75
const schematicRunner = new SchematicTestRunner (
@@ -84,7 +112,7 @@ describe('polyfillMetadataRule', () => {
84
112
const tree2 = await schematicRunner . runSchematicAsync ( 'migration-03' , { } , tree . branch ( ) )
85
113
. toPromise ( ) ;
86
114
87
- expect ( tree2 . readContent ( polyfillPath ) ) . not . toMatch ( / i m p o r t . * e s 7 . * r e f l e c t . * ; / ) ;
115
+ expect ( tree2 . readContent ( polyfillPath ) ) . toBe ( newPolyfills ) ;
88
116
} ) ;
89
117
90
118
it ( 'should work as expected for a project with a root' , async ( ) => {
@@ -96,6 +124,6 @@ describe('polyfillMetadataRule', () => {
96
124
const tree2 = await schematicRunner . runSchematicAsync ( 'migration-03' , { } , tree . branch ( ) )
97
125
. toPromise ( ) ;
98
126
99
- expect ( tree2 . readContent ( polyfillPath ) ) . not . toMatch ( / i m p o r t . * e s 7 . * r e f l e c t . * ; / ) ;
127
+ expect ( tree2 . readContent ( polyfillPath ) ) . toBe ( newPolyfills ) ;
100
128
} ) ;
101
129
} ) ;
0 commit comments