Merge pull request #725 from milesmatthias/next

added version function to mithril and test for version function
This commit is contained in:
Leo Horie 2015-07-17 09:42:07 -04:00
commit 952885d74f
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"})