 
 jsdom = getFreshJSDOM()
 
-compareRecords = (actual, expected) ->
+compareRecords = (actual, expected, test) ->
+    test.equal(actual.length, expected.length)
     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)
+    for i in [0..actual.length - 1]
+        test.equal(actual[i].type, expected[i].type)
+        test.equal(actual[i].name, expected[i].name)
         actualAttrs = actual[i].attributes
         if !actualAttrs
             test.equal(actualAttrs, expected[i].attributes)

            type : 'text'
    ]

    records = serialize(doc, null, doc)
    test.done()

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

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