本文整理匯總了TypeScript中vsts-task-lib/mock-test.MockTestRunner.stdErrContained方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MockTestRunner.stdErrContained方法的具體用法?TypeScript MockTestRunner.stdErrContained怎麽用?TypeScript MockTestRunner.stdErrContained使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vsts-task-lib/mock-test.MockTestRunner
的用法示例。
在下文中一共展示了MockTestRunner.stdErrContained方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("fails if alert rule name is configured for some other resource", (done: MochaDone) => {
let tmr : MockTestRunner = new MockTestRunner(path.join(__dirname, "L0AlertRuleNameConflictFail.js"));
tmr.run();
assert(tmr.stderr.length > 0 || tmr.errorIssues.length > 0, "should have written to stderr");
let expectedError = "loc_mock_AlertRuleTargetResourceIdMismatchError Rule1 /subscriptions/sId/resourceGroups/testRg/providers/testResource.provider/type/testResourceName2";
assert(tmr.stdErrContained(expectedError) || tmr.createdErrorIssue(expectedError), "should have thrown proper error message");
assert(tmr.failed, "task should have failed");
done();
});
示例2: it
it('fails if could not fetch all network interfaces in resource group', (done: MochaDone) => {
let tp = path.join(__dirname, 'L0TaskFailNetworkInterfaceRG.js');
let tmr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tmr.run();
assert(tmr.stderr.length > 0 || tmr.errorIssues.length > 0, 'should have written to stderr');
assert(tmr.stdErrContained("loc_mock_CouldNotFetchNetworkInterfacesInRg") || tmr.createdErrorIssue("loc_mock_CouldNotFetchNetworkInterfacesInRg"), "should have said : loc_mock_CouldNotFetchNicDetails");
assert(tmr.failed, 'task should have failed');
done();
});
示例3: it
it('Fails if XDT Transformation throws error (Mock)', (done) => {
let tp = path.join(__dirname, 'L0WindowsXdtTransformationFail.js');
let tr : ttm.MockTestRunner = new ttm.MockTestRunner(tp);
tr.run();
var expectedErr = 'Error: loc_mock_XdtTransformationErrorWhileTransforming C:\\tempFolder\\web.config C:\\tempFolder\\web.Release.config';
assert(tr.invokedToolCount == 1, 'should have invoked tool only once');
assert(tr.stderr.length > 0 || tr.errorIssues.length > 0, 'should have written to stderr');
assert(tr.stdErrContained(expectedErr) || tr.createdErrorIssue(expectedErr), 'E should have said: ' + expectedErr);
assert(tr.failed, 'task should have failed');
done();
});
示例4: it
it('Fails if package or folder name is invalid', (done) => {
let tp = path.join(__dirname, 'L0WindowsNoPackage.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 have written to stderr');
var expectedErr = 'Error: loc_mock_Nopackagefoundwithspecifiedpattern';
assert(tr.stdErrContained(expectedErr) || tr.createdErrorIssue(expectedErr), 'should have said: ' + expectedErr);
assert(tr.failed, 'task should have failed');
done();
});