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