Skip to content

Commit 8465538

Browse files
alan-agius4Keen Yee Liau
authored andcommitted
test(@schematics/angular): fix component schematic tests on Windows
1 parent bb7eee3 commit 8465538

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/schematics/angular/component/index_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,28 +253,28 @@ describe('Component Schematic', () => {
253253
const options = { ...defaultOptions, displayBlock: true };
254254
const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
255255
const content = tree.readContent('/projects/bar/src/app/foo/foo.component.css');
256-
expect(content).toMatch(/:host {\n display: block;\n}\n/);
256+
expect(content).toMatch(/:host {\r?\n display: block;\r?\n}/);
257257
});
258258

259259
it('should respect the displayBlock option when inlineStyle is `false` and use correct syntax for `scss`', async () => {
260260
const options = { ...defaultOptions, displayBlock: true, style: 'scss' };
261261
const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
262262
const content = tree.readContent('/projects/bar/src/app/foo/foo.component.scss');
263-
expect(content).toMatch(/:host {\n display: block;\n}\n/);
263+
expect(content).toMatch(/:host {\r?\n display: block;\r?\n}/);
264264
});
265265

266266
it('should respect the displayBlock option when inlineStyle is `false` and use correct syntax for `sass', async () => {
267267
const options = { ...defaultOptions, displayBlock: true, style: 'sass' };
268268
const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
269269
const content = tree.readContent('/projects/bar/src/app/foo/foo.component.sass');
270-
expect(content).toMatch(/\\:host\n display: block;\n/);
270+
expect(content).toMatch(/\\:host\r?\n display: block;\r?\n/);
271271
});
272272

273273
it('should respect the displayBlock option when inlineStyle is `true`', async () => {
274274
const options = { ...defaultOptions, displayBlock: true, inlineStyle: true };
275275
const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
276276
const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
277-
expect(content).toMatch(/:host {\n(\s*)display: block;(\s*)}\n/);
277+
expect(content).toMatch(/:host {\r?\n(\s*)display: block;(\s*)}\r?\n/);
278278
});
279279

280280
it('should respect the style option', async () => {

0 commit comments

Comments
 (0)