OO-ize DOM builder, improve performance (part 1), add benchmarking suite

This commit is contained in:
impinball 2015-12-15 07:07:50 -05:00
parent c202c04631
commit a7b2294c11
22 changed files with 1953 additions and 813 deletions

View file

@ -17,6 +17,21 @@ describe("m()", function () {
expect(m).to.be.a("function")
})
it("throws with an empty tag name", function () {
expect(function () {
m("")
}).to.throw(TypeError)
})
it("throws when the tag is not a string or object", function () {
expect(function () { m(0) }).to.throw(TypeError)
expect(function () { m(1) }).to.throw(TypeError)
expect(function () { m(true) }).to.throw(TypeError)
expect(function () { m(null) }).to.throw(TypeError)
expect(function () { m(undefined) }).to.throw(TypeError)
expect(function () { m([]) }).to.throw(TypeError)
})
it("sets correct tag name", function () {
expect(m("div")).to.have.property("tag", "div")
})