Skip to content

Commit d615ebe

Browse files
committed
Start cleaning up tests
1 parent 3074436 commit d615ebe

25 files changed

+392
-435
lines changed

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
},
2929
"devDependencies": {
3030
"async": "0.9.0",
31-
"co": "4.6.0",
3231
"jshint": "2.5.2",
3332
"pg-copy-streams": "0.3.0"
3433
},

Diff for: test/integration/client/appname-tests.js

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
return;
21
var helper = require('./test-helper');
32
var Client = helper.Client;
43

4+
var suite = new helper.Suite();
5+
56
var conInfo = helper.config;
67

78
function getConInfo(override) {
@@ -26,34 +27,37 @@ function getAppName(conf, cb) {
2627
}));
2728
}
2829

29-
test('No default appliation_name ', function(){
30+
suite.test('No default appliation_name ', function(done) {
3031
var conf = getConInfo();
31-
getAppName(conf, function(res){
32+
getAppName({ }, function(res){
3233
assert.strictEqual(res, '');
34+
done()
3335
});
3436
});
3537

36-
test('fallback_application_name is used', function(){
38+
suite.test('fallback_application_name is used', function(done) {
3739
var fbAppName = 'this is my app';
3840
var conf = getConInfo({
3941
'fallback_application_name' : fbAppName
4042
});
4143
getAppName(conf, function(res){
4244
assert.strictEqual(res, fbAppName);
45+
done()
4346
});
4447
});
4548

46-
test('application_name is used', function(){
49+
suite.test('application_name is used', function(done) {
4750
var appName = 'some wired !@#$% application_name';
4851
var conf = getConInfo({
4952
'application_name' : appName
5053
});
5154
getAppName(conf, function(res){
5255
assert.strictEqual(res, appName);
56+
done()
5357
});
5458
});
5559

56-
test('application_name has precedence over fallback_application_name', function(){
60+
suite.test('application_name has precedence over fallback_application_name', function(done) {
5761
var appName = 'some wired !@#$% application_name';
5862
var fbAppName = 'some other strange $$test$$ appname';
5963
var conf = getConInfo({
@@ -62,10 +66,11 @@ test('application_name has precedence over fallback_application_name', function(
6266
});
6367
getAppName(conf, function(res){
6468
assert.strictEqual(res, appName);
69+
done()
6570
});
6671
});
6772

68-
test('application_name from connection string', function(){
73+
suite.test('application_name from connection string', function(done) {
6974
var appName = 'my app';
7075
var conParams = require(__dirname + '/../../../lib/connection-parameters');
7176
var conf;
@@ -76,21 +81,20 @@ test('application_name from connection string', function(){
7681
}
7782
getAppName(conf, function(res){
7883
assert.strictEqual(res, appName);
84+
done()
7985
});
8086
});
8187

8288

8389

8490
// TODO: make the test work for native client too
8591
if (!helper.args.native) {
86-
test('application_name is read from the env', function(){
92+
suite.test('application_name is read from the env', function(done) {
8793
var appName = process.env.PGAPPNAME = 'testest';
88-
var conf = getConInfo({
89-
'just some bla' : 'to fool the pool'
90-
});
91-
getAppName(conf, function(res){
94+
getAppName({ }, function(res){
9295
delete process.env.PGAPPNAME;
9396
assert.strictEqual(res, appName);
97+
done()
9498
});
9599
});
96100
}

0 commit comments

Comments
 (0)