本文整理匯總了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']);
});
示例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);