some tests

This commit is contained in:
2023-06-01 22:02:03 +02:00
parent e3515901e4
commit 65a6312b8e
9 changed files with 153 additions and 40 deletions
+13 -13
View File
@@ -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));
+6 -4
View File
@@ -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);
}