Skip to content

Commit eba0020

Browse files
committed
Added more unit tests
1 parent 0db6875 commit eba0020

10 files changed

+30
-12
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "exceptionless",
3-
"version": "0.9.2",
3+
"version": "0.9.1",
44
"description": "JavaScript client for Exceptionless",
55
"license": "Apache",
66
"main": "dist/exceptionless.js",

dist/exceptionless.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "exceptionless",
3-
"version": "0.9.2",
3+
"version": "0.9.1",
44
"description": "JavaScript client for Exceptionless",
55
"license": "Apache",
66
"main": "dist/exceptionless.node.js",

src/ExceptionlessClient-spec.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,30 @@ describe('ExceptionlessClient', () => {
2626
});
2727
}, 5000);
2828

29-
it('should accept null sourceOrMessage', () => {
29+
it('should accept null source', () => {
3030
var client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
3131
var builder = client.createLog(null, 'Unit Test message', 'Trace');
3232

3333
expect(builder.target.source).toBeUndefined();
3434
expect(builder.target.message).toBe('Unit Test message');
3535
expect(builder.target.data['@level']).toBe('Trace');
3636
});
37+
38+
it('should accept source and message', () => {
39+
var client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
40+
var builder = client.createLog('ExceptionlessClient', 'Unit Test message');
41+
42+
expect(builder.target.source).toBe('ExceptionlessClient');
43+
expect(builder.target.message).toBe('Unit Test message');
44+
expect(builder.target.data).toBeUndefined();
45+
});
46+
47+
it('should accept source and message', () => {
48+
var client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
49+
var builder = client.createLog('Unit Test message');
50+
51+
expect(builder.target.source).toBeUndefined();
52+
expect(builder.target.message).toBe('Unit Test message');
53+
expect(builder.target.data).toBeUndefined();
54+
});
3755
});

src/ExceptionlessClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class ExceptionlessClient {
6565
builder = builder.setSource(sourceOrMessage).setMessage(message);
6666
} else {
6767
// TODO: Look into using https://www.stevefenton.co.uk/Content/Blog/Date/201304/Blog/Obtaining-A-Class-Name-At-Runtime-In-TypeScript/
68-
var caller = (<any>(arguments.callee.caller));
68+
var caller:any = arguments.callee.caller;
6969
builder = builder.setSource(caller && caller.name).setMessage(sourceOrMessage);
7070
}
7171

0 commit comments

Comments
 (0)