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


TypeScript TestSelectorFactory.instance方法代碼示例

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


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

示例1: beforeEach

 beforeEach(() => {
   options = {};
   sandbox = sinon.sandbox.create();
   sandbox.stub(TestSelectorFactory.instance(), 'create').returns(testSelector);
   sandbox.stub(TestSelectorFactory.instance(), 'knownNames').returns(['awesomeFramework', 'overrideTestSelector']);
 });
開發者ID:devlucas,項目名稱:stryker,代碼行數:6,代碼來源:TestSelectorOrchestratorSpec.ts

示例2: it

 it(`should use the value of "${expectedTestSelectorName}"`, () => expect(TestSelectorFactory.instance().create).to.have.been.calledWith(expectedTestSelectorName, { options }));
開發者ID:devlucas,項目名稱:stryker,代碼行數:1,代碼來源:TestSelectorOrchestratorSpec.ts

示例3: it

 it('should register it under "jasmine" in the TestSelectorFactory', () =>{
   expect(TestSelectorFactory.instance().create('jasmine', settings)).to.be.instanceof(JasmineTestSelector);
 });
開發者ID:devlucas,項目名稱:stryker,代碼行數:3,代碼來源:JasmineTestSelectorSpec.ts

示例4: testSelectorExists

 private testSelectorExists(maybeSelector: string) {
   return TestSelectorFactory.instance().knownNames().indexOf(maybeSelector) > -1;
 }
開發者ID:devlucas,項目名稱:stryker,代碼行數:3,代碼來源:TestSelectorOrchestrator.ts

示例5: createTestSelector

 private createTestSelector(name: string) {
   return TestSelectorFactory.instance().create(name, this.createSettings());
 }
開發者ID:devlucas,項目名稱:stryker,代碼行數:3,代碼來源:TestSelectorOrchestrator.ts

示例6: informAboutKnownTestSelectors

 private informAboutKnownTestSelectors() {
   return `Did you forget to load a plugin? Known test selectors: ${JSON.stringify(TestSelectorFactory.instance().knownNames())}.`;
 }
開發者ID:devlucas,項目名稱:stryker,代碼行數:3,代碼來源:TestSelectorOrchestrator.ts

示例7: function

import {TestSelector, TestSelectorSettings, TestSelectorFactory} from 'stryker-api/test_selector';

const INTERCEPTOR_CODE = `(function(global){
    var realIt = global.it, count = 0;
    var scoped = %IDS_PLACEHOLDER%;
    global.it = function(){
        if(scoped && scoped.indexOf(count) >= 0){
            var spec = realIt.apply(global, arguments);
        }
        count ++;
    }
})(window || global);`;


export default class JasmineTestSelector implements TestSelector {

  constructor(private settings: TestSelectorSettings) {
  }

  select(ids: number[]): string {
    return INTERCEPTOR_CODE.replace('%IDS_PLACEHOLDER%', JSON.stringify(ids));
  }
}

TestSelectorFactory.instance().register('jasmine', JasmineTestSelector);
開發者ID:devlucas,項目名稱:stryker,代碼行數:25,代碼來源:JasmineTestSelector.ts


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