-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathset_logger.js
More file actions
24 lines (22 loc) · 915 Bytes
/
set_logger.js
File metadata and controls
24 lines (22 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var set_logger = require("../set_logger");
require("should");
describe("set_logger", function(){
beforeEach(function () {
this.instance = {};
this.instance.logger = undefined;
this.instance.setLogger = set_logger;
});
it("attaches console by default", function(){
this.instance.setLogger();
this.instance.logger.should.be.an.instanceOf(Object).and.have.property("Console");
});
it("attaches a stubbed console on false", function(){
this.instance.setLogger(false);
this.instance.logger.should.be.an.instanceOf(Object).and.not.have.property("Console");
});
it("attaches whatever else is passed in, if defined and not false", function(){
// Demonstrates that we don't prevent the user from sending whatever they want to Logger
this.instance.setLogger("b");
this.instance.logger.should.equal("b");
});
});