OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <import src="../resources/mocha.sky" /> | |
3 <import src="../resources/chai.sky" /> | |
4 <script> | |
5 describe("Custom element constructor", function() { | |
6 it("should inherit from the passed constructor", function() { | |
7 class TestElementClass { | |
arv (Not doing code reviews)
2014/12/17 22:29:43
Don't you need extends HTMLElement as well?
| |
8 static test() { return 10; } | |
9 } | |
10 var TestElement = document.registerElement("test-element-1", { | |
11 prototype: TestElementClass.prototype, | |
12 }); | |
13 assert.isFunction(TestElement.test); | |
14 assert.equal(TestElement.test(), 10); | |
arv (Not doing code reviews)
2014/12/17 22:29:43
Maybe add:
assert.equal(Object.getPrototypeOf(Tes
| |
15 }); | |
16 }); | |
17 </script> | |
18 </html> | |
OLD | NEW |