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