@seanox/aspect-js
Version:
full stack JavaScript framework for SPAs incl. reactivity rendering, mvc / mvvm, models, expression language, datasource, routing, paths, unit test and some more
53 lines (48 loc) • 1.64 kB
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 type="text/javascript">
Test.activate();
Test.create({test() {
Assert.assertEquals("xx", DataSource.locale);
}});
Test.create({test() {
DataSource.localize("xx");
Assert.assertEquals("xx", DataSource.locale);
DataSource.localize("xde");
Assert.assertEquals("xde", DataSource.locale);
DataSource.localize("xen");
Assert.assertEquals("xen", DataSource.locale);
DataSource.localize("xx");
Assert.assertEquals("xx", DataSource.locale);
}});
Test.create({expected:/\bLocale not available/i, test() {
DataSource.localize("xxx");
}});
Test.create({expected:/\bLocale not available/i, test() {
DataSource.localize("");
}});
Test.create({expected:/\bLocale not available/i, test() {
DataSource.localize(" ");
}});
Test.create({expected:/\bInvalid locale: undefined/i, test() {
DataSource.localize();
}});
Test.create({expected:/\bInvalid locale: object/i, test() {
DataSource.localize(null);
}});
Test.start({auto:true});
</script>
</head>
<body>
</body>
</html>