• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript yeoman-test.run函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中yeoman-test.run函数的典型用法代码示例。如果您正苦于以下问题:TypeScript run函数的具体用法?TypeScript run怎么用?TypeScript run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test

 test(testName, (done) => {
   const TestGenerator = createElementGenerator('polymer-1.x');
   helpers.run(TestGenerator).on('end', () => {
     yoAssert.noFile(['_element.html']);
     done();
   });
 });
开发者ID:Polymer,项目名称:tools,代码行数:7,代码来源:element_test.ts


示例2: test

    test(testName, (done) => {
      let getSemverReleaseStub: sinon.SinonStub;
      let extractReleaseTarballStub: sinon.SinonStub;

      const TestGenerator = createTestGenerator(
          {
            owner: 'Polymer',
            repo: 'shop',
          },
          function setupGeneratorStubs(generator) {
            getSemverReleaseStub =
                // tslint:disable-next-line: no-any
                sinon.stub((generator as any)._github, 'getSemverRelease')
                    .returns(Promise.resolve(semverMatchingRelease));
            extractReleaseTarballStub =
                // tslint:disable-next-line: no-any
                sinon.stub((generator as any)._github, 'extractReleaseTarball')
                    .returns(Promise.resolve());
          });

      // tslint:disable-next-line: no-any
      helpers.run(TestGenerator as any).on('end', () => {
        assert.isOk(getSemverReleaseStub.calledWith('*'));
        assert.isOk(extractReleaseTarballStub.calledWith(
            semverMatchingRelease.tarball_url));
        done();
      });
    });
开发者ID:MehdiRaash,项目名称:tools,代码行数:28,代码来源:github_test.ts


示例3: test

    test(testName, (done) => {
      const testSemverRange = '^v123.456.789';
      let getSemverReleaseStub: sinon.SinonStub;
      let extractReleaseTarballStub: sinon.SinonStub;

      const TestGenerator = createTestGenerator(
          {
            owner: 'Polymer',
            repo: 'shop',
            semverRange: testSemverRange,
          },
          function setupGeneratorStubs(generator) {
            const {_github} = generator as unknown as {
              _github:
                  {getSemverRelease: unknown, extractReleaseTarball: unknown}
            };
            getSemverReleaseStub =
                // tslint:disable-next-line: no-any
                sinon.stub(_github, 'getSemverRelease')
                    .returns(Promise.resolve(semverMatchingRelease));
            extractReleaseTarballStub =
                // tslint:disable-next-line: no-any
                sinon.stub(_github, 'extractReleaseTarball')
                    .returns(Promise.resolve());
          });

      // tslint:disable-next-line: no-any
      helpers.run(TestGenerator as any).on('end', () => {
        assert.isOk(getSemverReleaseStub.calledWith(testSemverRange));
        assert.isOk(extractReleaseTarballStub.calledWith(
            semverMatchingRelease.tarball_url));
        done();
      });
    });
开发者ID:Polymer,项目名称:tools,代码行数:34,代码来源:github_test.ts


示例4: createApplicationGenerator

 (done) => {
   const TestGenerator = createApplicationGenerator('polymer-1.x');
   helpers.run(TestGenerator).on('end', () => {
     yoAssert.noFile(['src/_element/_element.html']);
     done();
   });
 });
开发者ID:abdonrd,项目名称:polymer-cli,代码行数:7,代码来源:application_test.ts


示例5:

        (resolve, reject): void => {
          this.runContext = helpers
            .run(path.join(__dirname, `../../../generators/${name}`), {
              tmpdir: false
            })
            .inDir(scratchDir)
            .withArguments(args)
            .withPrompts(prompt)
            .on(
              "ready",
              // We don't want to import any source statically, so can't import
              // type BaseGenerator
              // @ts-ignore
              (generator): void => {
                // .yo-rc.json is in topdir and yeoman-test silently resets
                // cwd to topdir (because of sinonjs masking the warning)
                // so override the reset
                generator.destinationRoot(scratchDir);

                // Also override the reset for every single subgen
                // @ts-ignore
                generator._composedWith.forEach(
                  // We don't want to import any source statically, so can't import
                  // type BaseGenerator
                  // @ts-ignore
                  (gen): void => {
                    gen.destinationRoot(scratchDir);
                  }
                );
              }
            )
            .on("end", resolve)
            .on("error", reject)
            .toPromise();
        }
开发者ID:jlenoble,项目名称:generator-wupjs,代码行数:35,代码来源:test-generator.ts


示例6: skipOnWindows

 skipOnWindows('test the Polymer 1.x "element" template', async () => {
   const dir =
       await runGenerator(createElementGenerator('polymer-1.x'))
           .withPrompts({name: 'my-element'})  // Mock the prompt answers
           .toPromise();
   await runCommand(binPath, ['install'], {cwd: dir});
   await runCommand(binPath, ['lint'], {cwd: dir});
   await runCommand(binPath, ['test'], {cwd: dir});
 });
开发者ID:poehlmann,项目名称:EvaluacionDiferencialDeLaMemoria,代码行数:9,代码来源:integration_test.ts


示例7: suiteSetup

    suiteSetup(async () => {
      const TSPGenerator = createGithubGenerator({
        owner: 'Polymer',
        repo: 'tools-sample-projects',
        githubToken,
      });

      tspDir = await runGenerator(TSPGenerator).toPromise();
    });
开发者ID:poehlmann,项目名称:EvaluacionDiferencialDeLaMemoria,代码行数:9,代码来源:integration_test.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript yn.default函数代码示例发布时间:2022-05-25
下一篇:
TypeScript yeoman-test.registerDependencies函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap