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


TypeScript MockTestRunner.stdOutContained方法代碼示例

本文整理匯總了TypeScript中azure-pipelines-task-lib/mock-test.MockTestRunner.stdOutContained方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MockTestRunner.stdOutContained方法的具體用法?TypeScript MockTestRunner.stdOutContained怎麽用?TypeScript MockTestRunner.stdOutContained使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在azure-pipelines-task-lib/mock-test.MockTestRunner的用法示例。


在下文中一共展示了MockTestRunner.stdOutContained方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

    it('Get specific version cache hit', (done: MochaDone) => {

        // Setup the mock runner
        const tp = path.join(__dirname, 'TestSetup.js');
        const tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        // Set the inputs
        process.env[constants.versionSelector] = 'specificVersion';
        process.env[constants.testPlatformVersion] = '15.6.0-preview-20171108-02';
        process.env[testConstants.expectedTestPlatformVersion] = '15.6.0-preview-20171108-02';
        process.env[testConstants.findLocalToolFirstCallReturnValue] = `VsTest\\${process.env[testConstants.expectedTestPlatformVersion]}`;

        // Start the run
        tr.run();

        // Asserts
        assert(tr.stderr.length === 0 || tr.errorIssues.length, 'should not have written to stderr');
        assert(tr.succeeded, `Task should have succeeded`);
        assert(tr.stdOutContained(`Looking for version ${process.env[testConstants.expectedTestPlatformVersion]} in the tools cache.`), `Should have looked for ${process.env[testConstants.expectedTestPlatformVersion]} in the cache.`);
        assert(tr.stdOutContained(`Cache hit for ${process.env[testConstants.expectedTestPlatformVersion]}`), `Expected a cache hit.`);
        assert(tr.stdOutContained(`Set variable VsTestToolsInstallerInstalledToolLocation value to VsTest\\${process.env[testConstants.expectedTestPlatformVersion]}.`), `Should have set variable to VsTest\\${process.env[testConstants.expectedTestPlatformVersion]}.`);
        assert(tr.stdOutContained('InstallationSuccessful'));

        done();
    });
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:25,代碼來源:L0.ts

示例2: it

    it('custom command succeeds with single service endpoint', (done: MochaDone) => {
        this.timeout(1000);
        let tp = path.join(__dirname, 'custom-singleEndpoint.js');
        let tr = new ttm.MockTestRunner(tp);

        tr.run();

        assert(tr.stdOutContained('npm custom successful'), 'npm custom command should have run');
        assert(tr.stdOutContained('http://example.com/1/'), 'debug output should have contained endpoint');
        assert(tr.succeeded, 'task should have succeeded');

        done();
    });
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:13,代碼來源:L0.ts

示例3: it

    it('test command with publish test results should call trx logger and publish test results with failed dotnet test', (done: MochaDone) => {
        this.timeout(1000);

        const tp = path.join(__dirname, './TestCommandTests/publishtestsWithFailedTestCommand.js');
        const tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

        tr.run();
        assert(tr.invokedToolCount == 1, 'should have run dotnet once');
        assert(tr.ran('c:\\path\\dotnet.exe test c:\\agent\\home\\directory\\temp.csproj --logger trx --results-directory c:\\agent\\home\\temp'), 'it should have run dotnet test');
        assert(tr.stdOutContained('dotnet error'), "should have dotnet output");
        assert(tr.stdOutContained('vso[results.publish type=VSTest;mergeResults=false;publishRunAttachments=true;resultFiles=c:\\agent\\home\\temp\\sample.trx;]'), "should publish trx");
        assert(tr.failed, 'should have failed');
        done();
    });
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:14,代碼來源:L0.ts


注:本文中的azure-pipelines-task-lib/mock-test.MockTestRunner.stdOutContained方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。