mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(tests): add missing test coverage for console errors
This commit is contained in:
@@ -7,3 +7,35 @@ it("renders without crashing", () => {
|
||||
const Index = require("./index.js");
|
||||
expect(Index).toBeTruthy();
|
||||
});
|
||||
|
||||
describe("console", () => {
|
||||
it("console.error() throws an error", () => {
|
||||
expect(() => {
|
||||
console.error("foo");
|
||||
}).toThrowError("message=foo args=");
|
||||
});
|
||||
|
||||
it("console.warn() throws an error", () => {
|
||||
expect(() => {
|
||||
console.warn("foo", "bar");
|
||||
}).toThrowError("message=foo args=bar");
|
||||
});
|
||||
|
||||
it("console.info() throws an error", () => {
|
||||
expect(() => {
|
||||
console.warn("foo", "bar", "abc");
|
||||
}).toThrowError("message=foo args=bar,abc");
|
||||
});
|
||||
|
||||
it("console.log() throws an error", () => {
|
||||
expect(() => {
|
||||
console.warn("foo bar");
|
||||
}).toThrowError("message=foo bar args=");
|
||||
});
|
||||
|
||||
it("console.trace() throws an error", () => {
|
||||
expect(() => {
|
||||
console.warn();
|
||||
}).toThrowError("message=undefined args=");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user