Skip to content

Commit e0cc1f3

Browse files
committed
Adds test for db.load()
1 parent c49a3d7 commit e0cc1f3

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎test/integration/models/model.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = function (db, cb) {
2+
setTimeout(function () {
3+
return cb();
4+
}, 500);
5+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = function (db, cb) {
2+
db.load("../model", function (err) {
3+
setTimeout(function () {
4+
return cb();
5+
}, 500);
6+
});
7+
};

‎test/integration/test-load.js‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var common = require('../common');
2+
var assert = require('assert');
3+
4+
common.createConnection(function (err, db) {
5+
// should load:
6+
//
7+
// models/sub/index
8+
// models/model (called from models/sub/index)
9+
db.load("./models/sub/", function (err) {
10+
assert.equal(err, null);
11+
db.close();
12+
});
13+
});

0 commit comments

Comments
 (0)