diff --git a/packages/schematics/angular/component/index_spec.ts b/packages/schematics/angular/component/index_spec.ts index 13ad0db416..786a8f57c2 100644 --- a/packages/schematics/angular/component/index_spec.ts +++ b/packages/schematics/angular/component/index_spec.ts @@ -253,28 +253,28 @@ describe('Component Schematic', () => { const options = { ...defaultOptions, displayBlock: true }; const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise(); const content = tree.readContent('/projects/bar/src/app/foo/foo.component.css'); - expect(content).toMatch(/:host {\n display: block;\n}\n/); + expect(content).toMatch(/:host {\r?\n display: block;\r?\n}/); }); it('should respect the displayBlock option when inlineStyle is `false` and use correct syntax for `scss`', async () => { const options = { ...defaultOptions, displayBlock: true, style: 'scss' }; const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise(); const content = tree.readContent('/projects/bar/src/app/foo/foo.component.scss'); - expect(content).toMatch(/:host {\n display: block;\n}\n/); + expect(content).toMatch(/:host {\r?\n display: block;\r?\n}/); }); it('should respect the displayBlock option when inlineStyle is `false` and use correct syntax for `sass', async () => { const options = { ...defaultOptions, displayBlock: true, style: 'sass' }; const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise(); const content = tree.readContent('/projects/bar/src/app/foo/foo.component.sass'); - expect(content).toMatch(/\\:host\n display: block;\n/); + expect(content).toMatch(/\\:host\r?\n display: block;\r?\n/); }); it('should respect the displayBlock option when inlineStyle is `true`', async () => { const options = { ...defaultOptions, displayBlock: true, inlineStyle: true }; const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise(); const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts'); - expect(content).toMatch(/:host {\n(\s*)display: block;(\s*)}\n/); + expect(content).toMatch(/:host {\r?\n(\s*)display: block;(\s*)}\r?\n/); }); it('should respect the style option', async () => {