##// END OF EJS Templates
working on fluent configuration
working on fluent configuration

File last commit:

r89:441fae622bca ts-plugin
r128:882b53b2ba5b ioc ts support
Show More
MockConsole.ts
52 lines | 1014 B | video/mp2t | TypeScriptLexer
import {NullConsole} from "../log/NullConsole";
interface ConsoleLineData {
level: string;
data: any[];
}
export class MockConsole extends NullConsole {
_buffer: ConsoleLineData[] = [];
debug(...args: any[]) {
this._buffer.push({
level: "debug",
data: args
});
}
log(...args: any[]) {
this._buffer.push({
level: "log",
data: args
});
}
warn(...args: any[]) {
this._buffer.push({
level: "warn",
data: args
});
}
error(...args: any[]) {
this._buffer.push({
level: "error",
data: args
});
}
getBuffer() {
return this._buffer;
}
getLine(i: number) {
if (i >= this._buffer.length)
throw new Error(`Line number ${i} is out of range, buffer.length = ${this._buffer.length}`);
return this._buffer[i].data;
}
clear() {
this._buffer = [];
}
}