Fix and refactors tests

This commit is contained in:
Behind The Math
2018-03-20 18:45:41 -04:00
parent cd7be77d99
commit f3dd755a97
7 changed files with 56 additions and 54 deletions

View File

@@ -1,7 +1,8 @@
var tape = require("tape")
var parseElement = require("../../../lib/proto/parse-element")
var protoMock = {
var pjax = {
attachLink: function() { return true },
attachForm: function() { return true }
}
@@ -9,12 +10,12 @@ var protoMock = {
tape("test parse element prototype method", function(t) {
t.doesNotThrow(function() {
var a = document.createElement("a")
parseElement.call(protoMock, a)
parseElement.call(pjax, a)
}, "<a> element can be parsed")
t.doesNotThrow(function() {
var form = document.createElement("form")
parseElement.call(protoMock, form)
parseElement.call(pjax, form)
}, "<form> element can be parsed")
t.end()