当前位置: 首页>>代码示例>>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;未经允许,请勿转载。