當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript yeoman-test.run函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。