Fix quotes issues in test and benchmark files

pull/471/head
Gijs Kruitbosch 6 years ago
parent f511d1aa2b
commit 30611cc57f

@ -1,4 +1,4 @@
var clean = require('matcha/lib/matcha/reporters/clean'); var clean = require("matcha/lib/matcha/reporters/clean");
function average(list) { function average(list) {
if (!list.length) if (!list.length)
@ -18,20 +18,20 @@ module.exports = function(runner, utils) {
var color = utils.color; var color = utils.color;
var results = {}; var results = {};
var currentResults = []; var currentResults = [];
runner.on('bench end', function(benchResults) { runner.on("bench end", function(benchResults) {
currentResults.push(benchResults.ops); currentResults.push(benchResults.ops);
}); });
runner.on('suite end', function(suite) { runner.on("suite end", function(suite) {
var avg = humanize(average(currentResults)); var avg = humanize(average(currentResults));
console.log(padBefore(avg + ' op/s', 22) + ' » ' + suite.title); console.log(padBefore(avg + " op/s", 22) + " » " + suite.title);
console.log(); console.log();
results[suite.title] = avg; results[suite.title] = avg;
currentResults = []; currentResults = [];
}); });
runner.on('end', function() { runner.on("end", function() {
for (var k in results) { for (var k in results) {
console.log(color(padBefore(k, 30) + ': ', 'gray') + results[k] + ' op/s'); console.log(color(padBefore(k, 30) + ": ", "gray") + results[k] + " op/s");
} }
console.log(); console.log();
}); });

@ -59,7 +59,7 @@ function fetchSource(url, callbackFn) {
client = require("https"); client = require("https");
} }
var options = urlparse(url); var options = urlparse(url);
options.headers = {'User-Agent': FFX_UA}; options.headers = {"User-Agent": FFX_UA};
client.get(options, function(response) { client.get(options, function(response) {
if (debug) { if (debug) {

@ -115,7 +115,7 @@ describe("Test JSDOM functionality", function() {
}); });
it("should have a working replaceChild", function() { it("should have a working replaceChild", function() {
var parent = baseDoc.getElementsByTagName('div')[0]; var parent = baseDoc.getElementsByTagName("div")[0];
var p = baseDoc.createElement("p"); var p = baseDoc.createElement("p");
p.setAttribute("id", "my-replaced-kid"); p.setAttribute("id", "my-replaced-kid");
var childCount = parent.childNodes.length; var childCount = parent.childNodes.length;

@ -95,10 +95,10 @@ function runTestsWithItems(label, domGenerationFn, source, expectedContent, expe
function genPath(node) { function genPath(node) {
if (node.id) { if (node.id) {
return '#' + node.id; return "#" + node.id;
} }
if (node.tagName == "BODY") { if (node.tagName == "BODY") {
return 'body'; return "body";
} }
var parent = node.parentNode; var parent = node.parentNode;
var parentPath = genPath(parent); var parentPath = genPath(parent);

Loading…
Cancel
Save