当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript test_selector.TestSelectorFactory类代码示例

本文整理汇总了TypeScript中stryker-api/test_selector.TestSelectorFactory的典型用法代码示例。如果您正苦于以下问题:TypeScript TestSelectorFactory类的具体用法?TypeScript TestSelectorFactory怎么用?TypeScript TestSelectorFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TestSelectorFactory类的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类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。