             type : 'text'
     ]
 
-    records = serialize(doc, null, doc)
+    actual = serialize(doc, null, doc)
+    compareRecords(actual, expected, test)
     test.done()
+
+exports['comments'] = (test) ->
+    doc = jsdom.jsdom("<html><body><!--Here's my comment!--></body></html>")
+    expected = [
+        type : 'element'
+        name : 'HTML'
+        attributes : undefined
+    ,
+        type : 'element'
+        name : 'BODY'
+        attributes : undefined
+    ,
+        type : 'comment'
+        name : undefined
+        value : "Here's my comment!"
+        attributes : undefined
+    ]
+    actual = serialize(doc, null, doc)
+    compareRecords(actual, expected, test)
+    test.done()
+
+exports['text'] = (test) ->
+    doc = jsdom.jsdom("<html><body>Here's my text!</body></html>")
+    expected = [
+        type : 'element'
+        name : 'HTML'
+        attribites : undefined
+    ,
+        type : 'element'
+        name : 'BODY'
+        attributes : undefined
+    ,
+        type : 'text'
+        name : undefined
+        attributes : undefined
+        value : "Here's my text!"
+    ]
+    actual = serialize(doc, null, doc)
+    compareRecords(actual, expected, test)
+    test.done()


jsdom = getFreshJSDOM()

compareRecords = (actual, expected) ->
    test.notEqual(actual, null)
    test.equal(actual.length, 5)

    for i in [0..4]
        test.equal(actual[i].type,   expected[i].type)
        test.equal(actual[i].id,     expected[i].id)
        test.equal(actual[i].parent, expected[i].parent)
        test.equal(actual[i].name,   expected[i].name)
        actualAttrs = actual[i].attributes
        if !actualAttrs
            test.equal(actualAttrs, expected[i].attributes)

    test.equal(records.length, 0)
    test.done()

exports['elements'] = (test) ->
    doc = jsdom.jsdom("<html>" +
                      "<head></head>" +
                      "<body><div><input type='text'></input></div></body>" +
