Skip to content

Commit

Permalink
add tests for invalid profiling level
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Apr 23, 2011
1 parent c01736f commit eb1a6a4
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions test/model.test.js
Expand Up @@ -3127,16 +3127,22 @@ module.exports = {

'setting profiling levels': function () {
var db = start();
db.setProfiling(2, function (err, doc) {
should.strictEqual(err, null);
db.setProfiling(1, 50, function (err, doc) {
should.strictEqual(err, null);
doc.was.should.eql(2);
db.setProfiling(0, function (err, doc) {
db.close();
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);
doc.was.should.eql(1);
doc.slowms.should.eql(50);
db.setProfiling(1, 50, function (err, doc) {
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);
});
});
});
});
});
Expand Down

0 comments on commit eb1a6a4

Please sign in to comment.