some tests
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import { NotificationBubbles } from "../../codeeditor-app/elements/notification-bubbles/notification-bubbles";
|
||||
|
||||
export function watchConsole(fn: (type: 'log' | 'info' | 'warn' | 'error', value: any) => void) {
|
||||
export function watchConsole(fn: (type: 'log' | 'info' | 'warn' | 'error', ...value: any[]) => void) {
|
||||
// define a new console
|
||||
var console: any = (function (oldCons) {
|
||||
return {
|
||||
log: function (text: any) {
|
||||
oldCons.log(text);
|
||||
fn('log', text);
|
||||
log: function (...data: any[]) {
|
||||
oldCons.log(...data);
|
||||
fn('log', data);
|
||||
},
|
||||
info: function (text: any) {
|
||||
oldCons.info(text);
|
||||
fn('info', text);
|
||||
info: function (...data: any[]) {
|
||||
oldCons.info(...data);
|
||||
fn('info', data);
|
||||
},
|
||||
warn: function (text: any) {
|
||||
oldCons.warn(text);
|
||||
fn('warn', text);
|
||||
warn: function (...data: any[]) {
|
||||
oldCons.warn(...data);
|
||||
fn('warn', data);
|
||||
},
|
||||
error: function (text: any) {
|
||||
oldCons.error(text);
|
||||
fn('error', text);
|
||||
error: function (...data: any[]) {
|
||||
oldCons.error(...data);
|
||||
fn('error', data);
|
||||
}
|
||||
};
|
||||
}(window.console));
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
setTimeout(() => {
|
||||
window.stop();
|
||||
console.log("window stopped");
|
||||
}, 4 * 1000);
|
||||
export function setWindowStop() {
|
||||
setTimeout(() => {
|
||||
window.stop();
|
||||
//throw new Error("window stopped");
|
||||
}, 4 * 1000);
|
||||
}
|
||||
Reference in New Issue
Block a user