本文整理汇总了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();
});
示例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();
});
示例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();
});