test-dom-comment.js 636 B

1234567891011121314151617181920
  1. var test = require("tape")
  2. module.exports = testDomComment
  3. function testDomComment(document) {
  4. var cleanup = require('./cleanup')(document)
  5. test("can createComment", function(assert) {
  6. var comment = document.createComment("test")
  7. assert.equal(comment.data, "test")
  8. assert.equal(comment.length, 4)
  9. assert.equal(comment.nodeName, "#comment")
  10. assert.equal(comment.nodeType, 8)
  11. assert.equal(comment.nodeValue, "test")
  12. assert.equal(comment.ownerDocument, document)
  13. assert.equal(comment.toString(), "[object Comment]")
  14. cleanup()
  15. assert.end()
  16. })
  17. }