Skip to content

Commit 05efca3

Browse files
committed
Merge pull request #38 from exceptionless/feature/betterBuild
Feature/Stringify
2 parents 319f7a0 + 80def85 commit 05efca3

26 files changed

+395
-218
lines changed

.vscode/launch.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": "0.1.0",
3+
"configurations": [
4+
{
5+
"name": "Test",
6+
"request": "launch",
7+
"type": "node",
8+
"program": "node_modules/.bin/_mocha",
9+
"args": [
10+
"dist/temp/exceptionless-spec.js"
11+
],
12+
"runtimeArgs": [
13+
"--nolazy"
14+
],
15+
"sourceMaps": true,
16+
"outDir": "dist"
17+
},
18+
{
19+
"name": "Attach",
20+
"request": "attach",
21+
"type": "node",
22+
"port": 5858,
23+
"sourceMaps": true,
24+
"outDir": "dist"
25+
}
26+
]
27+
}

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.insertFinalNewline": true
4+
}

.vscode/tasks.json

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"version": "0.1.0",
3+
"command": "gulp",
4+
"isShellCommand": true,
5+
"args": [
6+
"--no-color"
7+
],
8+
"tasks": [
9+
{
10+
"taskName": "build",
11+
"args": [],
12+
"isBuildCommand": true,
13+
"problemMatcher": {
14+
// The problem is owned by the cpp language service.
15+
"owner": "typescript",
16+
// The file name for reported problems is relative to the opened folder.
17+
"fileLocation": [
18+
"relative",
19+
"${workspaceRoot}/src"
20+
],
21+
// The actual pattern to match problems in the output.
22+
"pattern": {
23+
// The regular expression. Example to match: helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’ [-Wimplicit-function-declaration]
24+
"regexp": "\\[\\d\\d:\\d\\d:\\d\\d\\] \\[gulp-tslint\\] error \\([^)]+\\) ([^\\[]+)\\[(\\d+), (\\d+)\\]: (.+)$",
25+
// The first match group matches the file name which is relative.
26+
"file": 1,
27+
// The second match group matches the line on which the problem occurred.
28+
"line": 2,
29+
// The third match group matches the column at which the problem occurred.
30+
"column": 3,
31+
// The fifth match group matches the message.
32+
"message": 4
33+
}
34+
}
35+
},
36+
{
37+
"taskName": "test",
38+
"args": [],
39+
"isBuildCommand": true,
40+
"problemMatcher": {
41+
// The problem is owned by the cpp language service.
42+
"owner": "typescript",
43+
// The file name for reported problems is relative to the opened folder.
44+
"fileLocation": [
45+
"relative",
46+
"${workspaceRoot}/src"
47+
],
48+
// The actual pattern to match problems in the output.
49+
"pattern": {
50+
// The regular expression. Example to match: helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’ [-Wimplicit-function-declaration]
51+
"regexp": "\\[\\d\\d:\\d\\d:\\d\\d\\] \\[gulp-tslint\\] error \\([^)]+\\) ([^\\[]+)\\[(\\d+), (\\d+)\\]: (.+)$",
52+
// The first match group matches the file name which is relative.
53+
"file": 1,
54+
// The second match group matches the line on which the problem occurred.
55+
"line": 2,
56+
// The third match group matches the column at which the problem occurred.
57+
"column": 3,
58+
// The fifth match group matches the message.
59+
"message": 4
60+
}
61+
}
62+
}
63+
]
64+
}

dist/exceptionless.js

+11
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

+2-2
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

+11
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.

gulpfile.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,14 @@ gulp.task('exceptionless.test.umd', ['typescript.test'], function () {
116116
});
117117

118118
gulp.task('test', ['exceptionless.test.umd'], function(done) {
119-
var Server = require('karma').Server;
120-
new Server({
121-
configFile: __dirname + '/karma.conf.js'
122-
}, done).start();
119+
var mocha = require('gulp-mocha');
120+
return gulp.src('dist/temp/exceptionless-spec.js', { read: false })
121+
.pipe(mocha({
122+
require: ['source-map-support/register']
123+
}))
124+
.once('end', function () {
125+
process.exit();
126+
});
123127
});
124128

125129
gulp.task('format', function () {

karma.conf.js

-30
This file was deleted.

package.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,21 @@
2727
},
2828
"devDependencies": {
2929
"bower": "1.6.5",
30+
"chai": "^3.4.1",
3031
"del": "2.1.0",
3132
"es5-shim": "4.3.1",
3233
"es6-shim": "0.33.13",
3334
"gulp": "3.9.0",
3435
"gulp-concat": "2.6.0",
3536
"gulp-exec": "^2.1.2",
37+
"gulp-mocha": "^2.2.0",
3638
"gulp-replace": "0.5.4",
3739
"gulp-sourcemaps": "1.6.0",
3840
"gulp-tslint": "3.6.0",
3941
"gulp-uglify": "1.5.1",
4042
"gulp-wrap-umd": "0.2.1",
41-
"jasmine-core": "2.3.4",
42-
"karma": "0.13.15",
43-
"karma-chrome-launcher": "^0.2.1",
44-
"karma-cli": "0.1.1",
45-
"karma-jasmine": "0.3.6",
46-
"karma-phantomjs-launcher": "0.2.1",
47-
"phantomjs": "^1.9.18",
4843
"rimraf": "2.4.3",
44+
"source-map-support": "^0.3.3",
4945
"tracekit": "0.3.1",
5046
"tsproject": "1.0.5",
5147
"typescript": "1.6.2",

src/ExceptionlessClient-spec.ts

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
11
import { ExceptionlessClient } from './ExceptionlessClient';
22
import { EventPluginContext } from './plugins/EventPluginContext';
3+
import { expect } from 'chai';
34

45
describe('ExceptionlessClient', () => {
56
it('should use event reference ids', (done) => {
67
let error = new Error('From Unit Test');
78

89
let client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
9-
expect(client.config.lastReferenceIdManager.getLast()).toBe(null);
10+
expect(client.config.lastReferenceIdManager.getLast()).to.be.null;
1011
client.submitException(error, (context: EventPluginContext) => {
11-
expect(client.config.lastReferenceIdManager.getLast()).toBe(null);
12+
expect(client.config.lastReferenceIdManager.getLast()).to.be.null;
1213
});
1314

1415
let numberOfPlugins = client.config.plugins.length;
1516
client.config.useReferenceIds();
16-
expect(client.config.plugins.length).toBe(numberOfPlugins + 1);
17+
expect(client.config.plugins.length).to.equal(numberOfPlugins + 1);
1718

1819
client.submitException(error, (context: EventPluginContext) => {
1920
if (!context.cancelled) {
20-
expect(client.config.lastReferenceIdManager.getLast()).not.toBe(null);
21+
expect(client.config.lastReferenceIdManager.getLast()).not.to.be.null;
2122
} else {
22-
expect(client.config.lastReferenceIdManager.getLast()).toBe(null);
23+
expect(client.config.lastReferenceIdManager.getLast()).to.be.null;
2324
}
2425

2526
done();
27+
done = () => { };
2628
});
27-
}, 5000);
29+
});
2830

2931
it('should accept null source', () => {
3032
let client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
3133
let builder = client.createLog(null, 'Unit Test message', 'Trace');
3234

33-
expect(builder.target.source).toBeUndefined();
34-
expect(builder.target.message).toBe('Unit Test message');
35-
expect(builder.target.data['@level']).toBe('Trace');
35+
expect(builder.target.source).to.be.undefined;
36+
expect(builder.target.message).to.equal('Unit Test message');
37+
expect(builder.target.data['@level']).to.equal('Trace');
3638
});
3739

3840
it('should accept source and message', () => {
3941
let client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
4042
let builder = client.createLog('ExceptionlessClient', 'Unit Test message');
4143

42-
expect(builder.target.source).toBe('ExceptionlessClient');
43-
expect(builder.target.message).toBe('Unit Test message');
44-
expect(builder.target.data).toBeUndefined();
44+
expect(builder.target.source).to.equal('ExceptionlessClient');
45+
expect(builder.target.message).to.equal('Unit Test message');
46+
expect(builder.target.data).to.be.undefined;
4547
});
4648

4749
it('should accept source and message', () => {
4850
let client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
4951
let builder = client.createLog('Unit Test message');
5052

51-
expect(builder.target.source).toBeUndefined();
52-
expect(builder.target.message).toBe('Unit Test message');
53-
expect(builder.target.data).toBeUndefined();
53+
expect(builder.target.source).to.be.undefined;
54+
expect(builder.target.message).to.equal('Unit Test message');
55+
expect(builder.target.data).to.be.undefined;
5456
});
5557
});

0 commit comments

Comments
 (0)