added version function to mithril and test for version function
This commit is contained in:
parent
aeedc6fbb0
commit
d2812bd88d
2 changed files with 6 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
||||||
var m = (function app(window, undefined) {
|
var m = (function app(window, undefined) {
|
||||||
|
var VERSION = "v0.2.0-next";
|
||||||
|
|
||||||
function isFunction(object) {
|
function isFunction(object) {
|
||||||
return typeof object === "function";
|
return typeof object === "function";
|
||||||
}
|
}
|
||||||
|
|
@ -29,6 +31,9 @@ var m = (function app(window, undefined) {
|
||||||
|
|
||||||
initialize(window);
|
initialize(window);
|
||||||
|
|
||||||
|
m.version = function(){
|
||||||
|
return VERSION;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {String} Tag
|
* @typedef {String} Tag
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ function testMithril(mock) {
|
||||||
m.deps(mock)
|
m.deps(mock)
|
||||||
|
|
||||||
//m
|
//m
|
||||||
|
test(function() {return m.version().constructor === String})
|
||||||
test(function() {return m("div").tag === "div"})
|
test(function() {return m("div").tag === "div"})
|
||||||
test(function() {return m(".foo").tag === "div"})
|
test(function() {return m(".foo").tag === "div"})
|
||||||
test(function() {return m(".foo").attrs.className === "foo"})
|
test(function() {return m(".foo").attrs.className === "foo"})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue