added version function to mithril and test for version function

This commit is contained in:
Miles Matthias 2015-07-16 22:11:07 -06:00
parent aeedc6fbb0
commit d2812bd88d
2 changed files with 6 additions and 0 deletions

View file

@ -1,4 +1,6 @@
var m = (function app(window, undefined) {
var VERSION = "v0.2.0-next";
function isFunction(object) {
return typeof object === "function";
}
@ -29,6 +31,9 @@ var m = (function app(window, undefined) {
initialize(window);
m.version = function(){
return VERSION;
};
/**
* @typedef {String} Tag

View file

@ -2,6 +2,7 @@ function testMithril(mock) {
m.deps(mock)
//m
test(function() {return m.version().constructor === String})
test(function() {return m("div").tag === "div"})
test(function() {return m(".foo").tag === "div"})
test(function() {return m(".foo").attrs.className === "foo"})