All unit tests passing, all 3 methods of initializing working

This commit is contained in:
metacryst
2024-03-19 22:17:01 +01:00
parent b1d2370c0b
commit c0ccb138d1
6 changed files with 158 additions and 78 deletions

View File

@@ -1,5 +1,31 @@
window.testSuites.push( class testParse {
testParseConstructor() {
class Space extends Shadow {
form
contents = []
constructor(...params) {
super(...params)
}
}
let newClass = window.Registry.parseConstructor(Space)
if(!newClass.prototype.constructor.toString().includes("window.Registry.construct(")) {
return "'window.Registry.construct(' not detected!"
}
}
testParseConstructorIfNoneProvided() {
class Space extends Shadow {
$form
}
let newClass = window.Registry.parseConstructor(Space)
if(!newClass.prototype.constructor.toString().includes("window.Registry.construct(")) {
return "'window.Registry.construct(' not detected!"
}
}
testParseClassFieldsWithNoDefault() {
class Space extends Shadow {