本文整理汇总了TypeScript中EventPluginManager.EventPluginManager类的典型用法代码示例。如果您正苦于以下问题:TypeScript EventPluginManager类的具体用法?TypeScript EventPluginManager怎么用?TypeScript EventPluginManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EventPluginManager类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should ensure config plugins are not wrapped.', () => {
var client = new ExceptionlessClient({ apiKey:'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', serverUrl:'http://localhost:50000'});
var context = new EventPluginContext(client, {}, new ContextData());
expect(client.config.plugins).not.toBe(null);
while(client.config.plugins.length > 0) {
client.config.removePlugin(client.config.plugins[0]);
}
client.config.addPlugin('1', 1, (context:EventPluginContext, next?:() => void) => {
if (next) {
next();
}
});
expect(client.config.plugins[0].name).toBe('1');
expect(client.config.plugins.length).toBe(1);
EventPluginManager.run(context, (context?:EventPluginContext) => {
expect(client.config.plugins[0].name).toBe('1');
});
expect(client.config.plugins.length).toBe(1);
EventPluginManager.run(context, (context?:EventPluginContext) => {
expect(client.config.plugins[0].name).toBe('1');
});
expect(client.config.plugins.length).toBe(1);
});