当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript SchematicTestRunner.runSchematic方法代码示例

本文整理汇总了TypeScript中@angular-devkit/schematics/testing.SchematicTestRunner.runSchematic方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SchematicTestRunner.runSchematic方法的具体用法?TypeScript SchematicTestRunner.runSchematic怎么用?TypeScript SchematicTestRunner.runSchematic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular-devkit/schematics/testing.SchematicTestRunner的用法示例。


在下文中一共展示了SchematicTestRunner.runSchematic方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('should respect the option value', () => {
      const tree = runner.runSchematic(
          'drag-drop', {spec: false, ...baseOptions}, createTestApp(runner));

      expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.spec.ts');
    });
开发者ID:josephperrott,项目名称:material2,代码行数:6,代码来源:index.spec.ts

示例2: beforeEach

 beforeEach(() => {
   appTree = schematicRunner.runSchematic('workspace', workspaceOptions);
   appTree = schematicRunner.runSchematic('application', appOptions, appTree);
 });
开发者ID:DevIntent,项目名称:angular-cli,代码行数:4,代码来源:index_spec.ts

示例3: it

 it('should create an class named "Foo"', () => {
   const tree = schematicRunner.runSchematic('class', defaultOptions, appTree);
   const fileContent = tree.readContent('/projects/bar/src/app/foo.ts');
   expect(fileContent).toMatch(/export class Foo/);
 });
开发者ID:DevIntent,项目名称:angular-cli,代码行数:5,代码来源:index_spec.ts

示例4: expect

 expect(() => {
   runner.runSchematic('table', {project: 'material'}, createTestApp(runner));
 }).toThrowError(/required property 'name'/);
开发者ID:josephperrott,项目名称:material2,代码行数:3,代码来源:index.spec.ts

示例5: it

    it('should fall back to the @schematics/angular:component option value', () => {
      const tree = runner.runSchematic(
          'table', baseOptions, createTestApp(runner, {inlineStyle: true}));

      expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.css');
    });
开发者ID:josephperrott,项目名称:material2,代码行数:6,代码来源:index.spec.ts

示例6: it

 it('should have the latest Angular major versions in package.json named "foo"', () => {
   const tree = schematicRunner.runSchematic('library', defaultOptions, workspaceTree);
   const fileContent = getJsonFileContent(tree, '/projects/foo/package.json');
   const angularVersion = latestVersions.Angular.replace('~', '').replace('^', '');
   expect(fileContent.peerDependencies['@angular/core']).toBe(`^${angularVersion}`);
 });
开发者ID:cexbrayat,项目名称:angular-cli,代码行数:6,代码来源:index_spec.ts

示例7: it

 it('should create a guard', () => {
   const tree = schematicRunner.runSchematic('guard', defaultOptions, appTree);
   const files = tree.files;
   expect(files.indexOf('/projects/bar/src/app/foo.guard.spec.ts')).toBeGreaterThanOrEqual(0);
   expect(files.indexOf('/projects/bar/src/app/foo.guard.ts')).toBeGreaterThanOrEqual(0);
 });
开发者ID:fmalcher,项目名称:angular-cli,代码行数:6,代码来源:index_spec.ts

示例8: it

 it('should add dependency: @angular/platform-server', () => {
   const tree = schematicRunner.runSchematic('universal', defaultOptions, appTree);
   const filePath = '/package.json';
   const contents = tree.readContent(filePath);
   expect(contents).toMatch(/\"@angular\/platform-server\": \"/);
 });
开发者ID:rexebin,项目名称:angular-cli,代码行数:6,代码来源:index_spec.ts

示例9: it

 it('should set the CLI version in package.json', () => {
   const tree = schematicRunner.runSchematic('workspace', defaultOptions);
   const pkg = JSON.parse(tree.readContent('/package.json'));
   expect(pkg.devDependencies['@angular/cli']).toMatch('6.0.0');
 });
开发者ID:baconwaffles,项目名称:angular-cli,代码行数:5,代码来源:index_spec.ts


注:本文中的@angular-devkit/schematics/testing.SchematicTestRunner.runSchematic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。