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


TypeScript MockTestRunner.stdErrContained方法代碼示例

本文整理匯總了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();
    });
開發者ID:bleissem,項目名稱:vsts-tasks,代碼行數:10,代碼來源:L0.ts

示例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();
    });
開發者ID:DarqueWarrior,項目名稱:vsts-tasks,代碼行數:10,代碼來源:L0.ts

示例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();
        });
開發者ID:DarqueWarrior,項目名稱:vsts-tasks,代碼行數:12,代碼來源:L0.ts

示例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();
    });
開發者ID:mthalman-msft,項目名稱:vsts-tasks,代碼行數:13,代碼來源:L0.ts


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