forked from exceptionless/Exceptionless.JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptionlessClient-spec.ts
More file actions
28 lines (23 loc) · 1.05 KB
/
ExceptionlessClient-spec.ts
File metadata and controls
28 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { ExceptionlessClient } from 'ExceptionlessClient';
import { EventPluginContext } from './plugins/EventPluginContext';
describe('ExceptionlessClient', () => {
it('should use event reference ids', (done) => {
var error = new Error('From Unit Test');
var client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
expect(client.config.lastReferenceIdManager.getLast()).toBe(null);
client.submitException(error, (context:EventPluginContext) => {
expect(client.config.lastReferenceIdManager.getLast()).toBe(null);
});
var numberOfPlugins = client.config.plugins.length;
client.config.useReferenceIds();
expect(client.config.plugins.length).toBe(numberOfPlugins + 1);
client.submitException(error, (context:EventPluginContext) => {
if (!context.cancelled) {
expect(client.config.lastReferenceIdManager.getLast()).not.toBe(null);
} else {
expect(client.config.lastReferenceIdManager.getLast()).toBe(null);
}
done();
});
}, 5000);
});