UNPKG

@seanox/aspect-js

Version:

full stack JavaScript framework for SPAs incl. reactivity rendering, mvc / mvvm, models, expression language, datasource, virtual paths, unit test and some more

112 lines (108 loc) 2.26 kB
<!DOCTYPE HTML> <html> <head> <meta charset="ISO-8859-1"> <title>Seanox aspect-js test environment</title> <style> body { font-family: monospace; white-space: pre; } </style> <script src="aspect-js.js"></script> <script src="scripts/capture.js"></script> <script type="text/javascript"> Test.activate(); Composite.include("syntax"); const capture = new Capture(); Composite.listen(Composite.EVENT_RENDER_END, () => { capture.snap(); const count = capture.patterns().length; if (capture.size() === count) Test.start(); if (capture.size() > count) Assert.assertEquals("expected {1} steps but was {2}", count, capture.size()); }); Test.create({test() { capture.validate(); }}); </script> <script type="text/test"> false false false false false false ---- false false b1 is not defined in b1 b2 is not defined in b2 c1 is not defined in c1 c2 is not defined in c2 d1 is not defined in d1 d2 is not defined in d2 ---- undefined false false ---- #import syntaxC; #use u1.u2.u3; Composite.render("body"); </script> <script type="text/test"> false false false false false false ---- false false false false false false false false ---- object object object ---- #import syntaxC; #use u1.u2.u3; Composite.render("body"); </script> </head> <body> {{_1}} {{_2}} {{_3}} {{_4}} {{_5}} {{_6}} ---- {{a1}} {{a2}} {{b1}} {{b2}} {{c1}} {{c2}} {{d1}} {{d2}} ---- {{(?typeof u1)}} {{(?typeof u1.u2)}} {{(?typeof u1.u2.u3)}} ---- <script type="composite/javascript"> #import syntaxC; #use u1.u2.u3; Composite.render("body"); </script> </body> </html>