Prettier fixes

This commit is contained in:
Behind The Math
2019-03-03 01:37:45 -05:00
parent 3c1a4b2e18
commit c13149626b
32 changed files with 1318 additions and 903 deletions

View File

@@ -1,16 +1,25 @@
var tape = require("tape")
var tape = require("tape");
var contains = require("../../../lib/util/contains.js")
var contains = require("../../../lib/util/contains.js");
tape("test contains function", function(t) {
var tempDoc = document.implementation.createHTMLDocument()
tempDoc.body.innerHTML = "<div><p id='el' class='js-Pjax'></p></div><span></span>"
var selectors = ["div"]
var el = tempDoc.body.querySelector("#el")
t.equal(contains(tempDoc, selectors, el), true, "contains() returns true when a selector contains the element")
var tempDoc = document.implementation.createHTMLDocument();
tempDoc.body.innerHTML =
"<div><p id='el' class='js-Pjax'></p></div><span></span>";
var selectors = ["div"];
var el = tempDoc.body.querySelector("#el");
t.equal(
contains(tempDoc, selectors, el),
true,
"contains() returns true when a selector contains the element"
);
selectors = ["span"]
t.equal(contains(tempDoc, selectors, el), false, "contains() returns false when the selectors do not contain the element")
selectors = ["span"];
t.equal(
contains(tempDoc, selectors, el),
false,
"contains() returns false when the selectors do not contain the element"
);
t.end()
})
t.end();
});