Skip to content

Commit fcd2350

Browse files
committed
refactoring and adding more nodejs versions to travis
1 parent 87f7bf5 commit fcd2350

File tree

6 files changed

+12
-25
lines changed

6 files changed

+12
-25
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"mocha": true
77
},
88
"rules": {
9-
"semi": [2, "always"]
9+
"semi": [2, "always"],
10+
"no-unused-vars": ["error", { "vars": "all", "args": "none" }]
1011
}
1112
}

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
language: node_js
22
node_js:
3-
- "4.2.4"
3+
- "0.10"
4+
- "0.12"
5+
- "4"
6+
- "5"
47
- "stable"

examples/express/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ app.get('/', function (req, res) {
1717

1818
app.get('/multi-query', function (req, res) {
1919
pg.connect(connString, function (err, client, done) {
20-
client.query('SELECT pg_sleep(1)', [], function (err) {
21-
client.query('SELECT $1::int AS number', ['2'], function (err) {
20+
client.query('SELECT pg_sleep(1)', [], function (err, result) {
21+
client.query('SELECT $1::int AS number', ['2'], function (err, result) {
2222
done();
2323
res.render('multi-query');
2424
});

lib/miniprofiler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var qs = require('querystring');
1616
var url = require('url');
1717
var utils = require('./utils.js');
1818
var uuid = require('node-uuid');
19+
var debug = require('debug')('miniprofiler');
1920

2021
_.templateSettings = {
2122
interpolate: /\{(.+?)\}/g
@@ -418,7 +419,7 @@ function describePerformance(root, request) {
418419
function diff(start, stop){
419420
if (!stop) {
420421
stop = process.hrtime();
421-
console.error('missing stop, using', stop);
422+
debug('missing stop, using', stop);
422423
}
423424
var deltaSecs = stop[0] - start[0];
424425
var deltaNanoSecs = stop[1] - start[1];

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"main": "lib/miniprofiler.js",
66
"scripts": {
77
"lint": "eslint .",
8-
"test": "mocha tests/",
9-
"coverage": "istanbul cover node_modules/mocha/bin/_mocha tests/"
8+
"test": "istanbul cover node_modules/mocha/bin/_mocha tests/"
109
},
1110
"repository": {
1211
"type": "git",
@@ -16,6 +15,7 @@
1615
"license": "Apache-2.0",
1716
"readmeFilename": "README.md",
1817
"dependencies": {
18+
"debug": "^2.2.0",
1919
"node-uuid": "^1.4.7",
2020
"underscore": "1.5.2"
2121
},

tests/utils-test.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,6 @@ var expect = require('chai').expect;
22
var utils = require('../lib/utils.js');
33

44
describe('Utils Tests', function() {
5-
[
6-
[ 'apple', 'ap' ],
7-
[ 'Apple', 'Ap' ]
8-
].forEach((testCase) => {
9-
it(`${testCase[0]} should start with ${testCase[1]}`, function() {
10-
expect(testCase[0].startsWith(testCase[1])).to.be.true;
11-
});
12-
});
13-
14-
[
15-
[ 'Apple', 'ap' ],
16-
[ 'apple', 'at' ]
17-
].forEach((testCase) => {
18-
it(`${testCase[0]} should not start with ${testCase[1]}`, function() {
19-
expect(testCase[0].startsWith(testCase[1])).to.be.false;
20-
});
21-
});
22-
235
[
246
[ 'a=1&b=2', 'a=1&b=2' ],
257
[ '"Hello"', '"Hello"' ],

0 commit comments

Comments
 (0)