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


TypeScript MockTestRunner.run方法代码示例

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


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

示例1: it

 it('Runs successfully for windows docker compose up command with ACR and additional docker compose file not present warning', (done:MochaDone) => {
     let tp = path.join(__dirname, 'L0Windows.js');
     let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
     process.env["__command__"] = "Run a Docker Compose command";
     process.env["__container_type__"] = "Azure Container Registry";
     process.env["__additionalDockerComposeFiles__"] = "F:\\dir2\\docker-compose.override-notpresent.yml";
     process.env["__dockerComposeCommand__"] = "up -d"
     
     tr.run();
     
     assert(tr.invokedToolCount == 1, 'should have invoked tool one times. actual: ' + tr.invokedToolCount);
     assert(tr.stderr.length == 0 || tr.errorIssues.length, 'should not have written to stderr');
     assert(tr.succeeded, 'task should have succeeded');
     assert(tr.stdout.indexOf("[command]docker-compose -f F:\\dir2\\docker-compose.yml up -d") != -1, "successfully ran up command");
     assert(tr.stdout.indexOf("vso[task.issue type=warning;]loc_mock_AdditionalDockerComposeFileDoesNotExists F:\\dir2\\docker-compose.override-notpresent.yml") != -1, "successfully identified missing override file.");
     console.log(tr.stderr);
     done();
 });
开发者ID:bleissem,项目名称:vsts-tasks,代码行数:18,代码来源:L0.ts

示例2: it

    it('Validate bitbucket commit url', (done) => {

        const tp: string = path.join(__dirname, 'L0ValidateBitBucketCommitUrl.js');
        const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        try {
            tr.run();

            assert(tr.stdout.indexOf('Translated url http://bitbucket.org/commits/3cbfc14e3f482a25e5122323f3273b89677d9875 after fixing the query path based on the provider') !== -1, tr.stdout);

            done();
        } catch(err) {
            console.log(tr.stdout);
            console.log(tr.stderr);
            console.log(err);
            done(err);
        }
    });
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:18,代码来源:L0.ts

示例3: it

    it('Should fail if invalid buildId mentioned for Freestyle job type', (done) => {
        const tp: string = path.join(__dirname, 'L0ShouldFailIfInvalidBuildIdMentionedForFreeStyleJob.js');
        const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        try {
            tr.run();

            assert(tr.stdout.indexOf('InvalidBuildId') !== -1, tr.stdout);
            assert(tr.failed, 'task should have failed');

            done();
        } catch(err) {
            console.log(tr.stdout);
            console.log(tr.stderr);
            console.log(err);
            done(err);
        }
    });
开发者ID:grawcho,项目名称:vso-agent-tasks,代码行数:18,代码来源:L0.ts

示例4: it

        it("[windows]should not install again if cache hit", (done) => {
            process.env["__cache_hit__"] = "true";
            let tp = path.join(__dirname, "InstallWindows.js");
            let tr = new ttm.MockTestRunner(tp);
            tr.run();
            delete process.env["__cache_hit__"];

            runValidations(() => {
                assert(tr.succeeded, "Should have succeeded");
                assert(tr.stdout.indexOf("loc_mock_ToolToInstall sdk 1.0.4") > -1, "should print to-be-installed info");
                assert(tr.stdout.indexOf("Checking local tool for dncs and version 1.0.4") > -1, "should check for local cached tool");
                assert(tr.stdout.indexOf("loc_mock_InstallingAfresh") == -1, "should not install fresh");
                assert(tr.stdout.indexOf("loc_mock_GettingDownloadUrls") == -1, "should not download");
                assert(tr.stdout.indexOf("loc_mock_UsingCachedTool") > -1, "should print that cached dir is being used");
                assert(tr.stdout.indexOf("Caching dir C:\\agent\\_temp\\someDir for tool dncs version 1.0.4") == -1, "should not update cache again");
                assert(tr.stdout.indexOf("prepending path: C:\\agent\\_tools\\oldCacheDir") > -1, "should pre-prend to PATH");
            }, tr, done);
        });
开发者ID:bleissem,项目名称:vsts-tasks,代码行数:18,代码来源:L0.ts

示例5: it

        it('Runs KuduDeploy successfully with folder archiving on non-windows agent', (done) => {
            let tp = path.join(__dirname, 'L0NonWindowsFolderPkg.js');
            let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
            tr.run();

            assert(tr.invokedToolCount == 0, 'should not have invoked any tool');
            assert(tr.stderr.length == 0 && tr.errorIssues.length == 0, 'should not have written to stderr');
            var expectedOut = 'Compressed folder '; 
            assert(tr.stdout.search(expectedOut) > 0, 'should have said: ' + expectedOut);
            expectedOut = 'Deployed using KuduDeploy'; 
            assert(tr.stdout.search(expectedOut) > 0, 'should have said: ' + expectedOut);
            expectedOut = 'Updated history to kudu'; 
            assert(tr.stdout.search(expectedOut) > 0, 'should have said: ' + expectedOut);
            expectedOut = 'Successfully updated scmType to VSTSRM';
            assert(tr.stdout.search(expectedOut) > 0, 'should have said: ' + expectedOut);
            assert(tr.succeeded, 'task should have succeeded');
            done();
        });
开发者ID:ReneSchumacher,项目名称:VSTS-Tasks,代码行数:18,代码来源:L0.ts

示例6: it

    it('XamariniOS clean build', (done:MochaDone) => {
        this.timeout(1000);

        let tp = path.join(__dirname, 'L0CleanBuild.js');
        let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        tr.run();

        assert(tr.ran('/home/bin/xbuild src/project.sln /p:Configuration=Release /p:Platform=iPhone /t:Clean'),
        'xbuild /t:Clean should have run');
        assert(tr.ran('/home/bin/nuget restore src/project.sln'), 'nuget restore should have run');
        assert(tr.ran('/home/bin/xbuild src/project.sln /p:Configuration=Release /p:Platform=iPhone'),
        'xbuild should have run');
        assert(tr.stderr.length == 0, 'should not have written to stderr');
        assert(tr.succeeded, 'task should have succeeded');

        done();
    });
开发者ID:DarqueWarrior,项目名称:vsts-tasks,代码行数:18,代码来源:L0.ts


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