##// END OF EJS Templates
added provided and configure methods to the fluent container configuration, added applyConfig method to the container
added provided and configure methods to the fluent container configuration, added applyConfig method to the container

File last commit:

r89:441fae622bca ts-plugin
r142:be7edf08a115 v1.4.0-rc3 default
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 = [];
}
}