mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
test(@schematics/angular): fix component schematic tests on Windows
This commit is contained in:
parent
bb7eee31c9
commit
8465538f9d
@ -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 () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user