本文整理汇总了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']);
});
示例2: it
it(`should use the value of "${expectedTestSelectorName}"`, () => expect(TestSelectorFactory.instance().create).to.have.been.calledWith(expectedTestSelectorName, { options }));
示例3: it
it('should register it under "jasmine" in the TestSelectorFactory', () =>{
expect(TestSelectorFactory.instance().create('jasmine', settings)).to.be.instanceof(JasmineTestSelector);
});
示例4: testSelectorExists
private testSelectorExists(maybeSelector: string) {
return TestSelectorFactory.instance().knownNames().indexOf(maybeSelector) > -1;
}
示例5: createTestSelector
private createTestSelector(name: string) {
return TestSelectorFactory.instance().create(name, this.createSettings());
}
示例6: informAboutKnownTestSelectors
private informAboutKnownTestSelectors() {
return `Did you forget to load a plugin? Known test selectors: ${JSON.stringify(TestSelectorFactory.instance().knownNames())}.`;
}
示例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);