wip: adding more tests
All checks were successful
/ test (push) Successful in 12s

This commit is contained in:
Leon van Kammen 2025-06-10 15:08:11 +02:00
parent ab5efe4a33
commit bd9de85ffc
2 changed files with 11 additions and 1 deletions

9
src/tests/index.js Normal file
View file

@ -0,0 +1,9 @@
const run = async function(){
await AFRAME.utils.require({
"test_util": "tests/util.js",
"test_isoterminal":"tests/ISOTerminal.js"
})
console.test.run()
}
run()

View file

@ -4,13 +4,14 @@ console.test = async (name,cb) => {
let tests = console.test.tests = console.test.tests || {}
tests[name] = tests[name] || []
tests[name].push(cb)
console.test.run = async () => {
console.test.run = async (cb) => {
for( let name in tests ){
console.log("\x1b[34m\x1b[36;49m"+name+"\x1B[m")
for( let test in tests[name] ){
await tests[name][test]()
}
}
if( cb ) cb()
}
}