當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。