Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Add no logger tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-roemer committed Feb 28, 2015
1 parent 670398c commit 7f4d2b2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions simple-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
};

// UMD wrapper: Borrowed from webpack version.
/* istanbul ignore next */
function umd() {
if (typeof exports === "object" && typeof module === "object") {
// CommonJS
Expand Down
29 changes: 28 additions & 1 deletion test/spec/simple-console.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
describe("simple-console", function () {
describe("no logger", function () {
var conStub,
con;

beforeEach(function () {
// By default, returns `undefined`.
conStub = sinon.stub(SimpleConsole.prototype, "_getConsole");
con = new SimpleConsole();
});

afterEach(function () {
conStub.restore();
});

it("should invoke lots of functions and not die", function () {
con.log("log");
con.log.apply(con, ["log apply"]);
con.log.call(con, "log call");
con.warn("warn");
con.warn.apply(con, ["warn apply"]);
con.warn.call(con, "warn call");
con.error("warn");
con.error.apply(con, ["warn apply"]);
con.error.call(con, "warn call");
});
});

describe("invocations", function () {
var con;

Expand All @@ -8,7 +35,7 @@ describe("simple-console", function () {

// Just do a lot of invocations and see if anything dies.
// This _will_ clog the output, so do them last...
it("should invoke lots of functions", function () {
it("should invoke lots of functions and maybe log out", function () {
con.log("log");
con.log.apply(con, ["log apply"]);
con.log.call(con, "log call");
Expand Down

0 comments on commit 7f4d2b2

Please sign in to comment.