Skip to content

Commit 1c00123

Browse files
committed
adding tests
1 parent 0dfd3c5 commit 1c00123

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

test/config_test.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,22 @@ vows.describe('config').addBatch({
106106
assert.equal(current.settings.database, 'dbname');
107107
}
108108
}
109-
}).export(module);
109+
}).addBatch({
110+
'loading a config with null values': {
111+
topic: function() {
112+
var configPath = path.join(__dirname, 'database_with_null_values.json');
113+
config.load = _configLoad;
114+
config.loadUrl = _configLoadUrl;
115+
try {
116+
config.load(configPath, 'dev');
117+
}catch(e) {
118+
return e;
119+
}
120+
return null;
121+
},
110122

123+
'should something': function(err) {
124+
assert.isNull(err);
125+
}
126+
}
127+
}).export(module);

test/database_with_null_values.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"dev": {
3+
"driver": null,
4+
"filename": ":memory:"
5+
},
6+
7+
"test": {
8+
"driver": null,
9+
"filename": ":memory:"
10+
},
11+
12+
"prod": {
13+
"driver": null,
14+
"filename": "prod.db"
15+
}
16+
}

0 commit comments

Comments
 (0)