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,24 +1,40 @@
var tape = require("tape")
var tape = require("tape");
var forEachEls = require("../../lib/foreach-selectors.js")
var forEachEls = require("../../lib/foreach-selectors.js");
var cb = function(el) {
el.className = "modified"
}
el.className = "modified";
};
tape("test forEachSelector", function(t) {
forEachEls(["html", "body"], cb)
forEachEls(["html", "body"], cb);
t.equal(document.documentElement.className, "modified", "callback has been executed on first selector")
t.equal(document.body.className, "modified", "callback has been executed on first selector")
t.equal(
document.documentElement.className,
"modified",
"callback has been executed on first selector"
);
t.equal(
document.body.className,
"modified",
"callback has been executed on first selector"
);
document.documentElement.className = ""
document.body.className = ""
document.documentElement.className = "";
document.body.className = "";
forEachEls(["html", "body"], cb, null, document.documentElement)
forEachEls(["html", "body"], cb, null, document.documentElement);
t.equal(document.documentElement.className, "", "callback has not been executed on first selector when context is used")
t.equal(document.body.className, "modified", "callback has been executed on first selector when context is used")
t.equal(
document.documentElement.className,
"",
"callback has not been executed on first selector when context is used"
);
t.equal(
document.body.className,
"modified",
"callback has been executed on first selector when context is used"
);
t.end()
})
t.end();
});