@@ -42,6 +42,34 @@ import 'web-animations-js'; // Run \`npm install --save web-animations-js\`.
4242import 'zone.js/dist/zone'; // Included with Angular CLI.
4343` ;
4444
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+
4573
4674describe ( 'polyfillMetadataRule' , ( ) => {
4775 const schematicRunner = new SchematicTestRunner (
@@ -84,7 +112,7 @@ describe('polyfillMetadataRule', () => {
84112 const tree2 = await schematicRunner . runSchematicAsync ( 'migration-03' , { } , tree . branch ( ) )
85113 . toPromise ( ) ;
86114
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 ) ;
88116 } ) ;
89117
90118 it ( 'should work as expected for a project with a root' , async ( ) => {
@@ -96,6 +124,6 @@ describe('polyfillMetadataRule', () => {
96124 const tree2 = await schematicRunner . runSchematicAsync ( 'migration-03' , { } , tree . branch ( ) )
97125 . toPromise ( ) ;
98126
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 ) ;
100128 } ) ;
101129} ) ;
0 commit comments