Permalink
Browse files

add failing test; db.setProfile doesn't wait for db#open event

  • Loading branch information...
1 parent 10676ba commit 60c0190aea5c1b8d12ef816b8a7ab02ed7de2d05 @aheckmann aheckmann committed May 17, 2011
Showing with 13 additions and 15 deletions.
  1. +13 −15 test/model.test.js
View
@@ -3259,26 +3259,24 @@ module.exports = {
'setting profiling levels': function () {
var db = start();
- db.on('open', function () {
- db.setProfiling(3, function (err) {
- err.message.should.eql('Invalid profiling level: 3');
- db.setProfiling('fail', function (err) {
- err.message.should.eql('Invalid profiling level: fail');
- db.setProfiling(2, function (err, doc) {
+ db.setProfiling(3, function (err) {
+ err.message.should.eql('Invalid profiling level: 3');
+ db.setProfiling('fail', function (err) {
+ err.message.should.eql('Invalid profiling level: fail');
+ db.setProfiling(2, function (err, doc) {
+ should.strictEqual(err, null);
+ db.setProfiling(1, 50, function (err, doc) {
should.strictEqual(err, null);
- db.setProfiling(1, 50, function (err, doc) {
+ doc.was.should.eql(2);
+ db.setProfiling(0, function (err, doc) {
+ db.close();
should.strictEqual(err, null);
- doc.was.should.eql(2);
- db.setProfiling(0, function (err, doc) {
- db.close();
- should.strictEqual(err, null);
- doc.was.should.eql(1);
- doc.slowms.should.eql(50);
- });
+ doc.was.should.eql(1);
+ doc.slowms.should.eql(50);
});
});
});
});
- })
+ });
}
};

0 comments on commit 60c0190

Please sign in to comment.