console.log("Tests initializing.") window.testSuites = []; await import ("./parse.test.js") await import ("./shadow.test.js") window.test = async function() { // window.testSuites.sort(); window.alert = () => true; window.confirm = () => true; let failed = 0; let success = 0; var start = new Date(); for(let j=0; j 0) { for(let i=0; i < spaceNum; i++) { spaces += " " } } console.log(`%c ${fail}${spaces}`, 'border-bottom: 2px solid #e9c9a0; color: rgb(254, 62, 43); border-radius: 10px; padding: 10px'); } else { success++; console.log(`%c${testNum}. ${test}`, 'border-bottom: 2px solid #e9c9a0; background: #628c60; color: transparent; border-radius: 10px; padding: 0px 10px 0px 10px'); } } // Need to flush ws buffer since saving is disabled, and that is what usually does the flushing // Frame.ws.sendMessage('Flush Buffer'); } // await wait(100); } console.log("") console.log("") let elapsed = new Date() - start; if(failed === 0) { console.log(`%cRan ${failed+success} tests in ${elapsed}ms`, 'background: #222; color: #00FF00'); console.log(`%c ${success} passed`, 'background: #222; color: #00FF00'); console.log(`%c ${failed} failed`, 'background: #222;'); } else { console.log(`%cRan ${failed+success} tests in ${elapsed}ms`, 'background: #222; color: rgb(254, 62, 43)'); console.log(`%c ${success} `, 'background: #222; color: #00FF00', "passed"); console.log(`%c ${failed} failed`, 'background: #222; color: rgb(254, 62, 43)'); } } window.wait = ms => new Promise(res => setTimeout(res, ms)); window.__defineGetter__("test", test); window.test