Merge branch 'prefer-const' of https://github.com/graingert/CyberChef into graingert-prefer-const

This commit is contained in:
n1474335 2017-05-06 14:11:38 +01:00
commit 5efe9bd91d
15 changed files with 165 additions and 163 deletions

View file

@ -38,7 +38,7 @@ import Chef from "../src/core/Chef.js";
TestRegister.prototype.runTests = function() {
return Promise.all(
this.tests.map(function(test, i) {
let chef = new Chef();
const chef = new Chef();
return chef.bake(
test.input,
@ -48,7 +48,7 @@ import Chef from "../src/core/Chef.js";
false
)
.then(function(result) {
let ret = {
const ret = {
test: test,
status: null,
output: null,

View file

@ -19,10 +19,10 @@ import "./tests/operations/FlowControl.js";
import "./tests/operations/MorseCode.js";
import "./tests/operations/StrUtils.js";
let allTestsPassing = true,
testStatusCounts = {
total: 0,
};
let allTestsPassing = true;
const testStatusCounts = {
total: 0,
};
/**
@ -32,7 +32,7 @@ let allTestsPassing = true,
* @returns {string}
*/
function statusToIcon(status) {
let icons = {
const icons = {
erroring: "🔥",
failing: "❌",
passing: "✔️️",
@ -48,7 +48,7 @@ function statusToIcon(status) {
*/
function handleTestResult(testResult) {
allTestsPassing = allTestsPassing && testResult.status === "passing";
let newCount = (testStatusCounts[testResult.status] || 0) + 1;
const newCount = (testStatusCounts[testResult.status] || 0) + 1;
testStatusCounts[testResult.status] = newCount;
testStatusCounts.total += 1;
@ -83,8 +83,8 @@ TestRegister.runTests()
console.log("\n");
for (let testStatus in testStatusCounts) {
let count = testStatusCounts[testStatus];
for (const testStatus in testStatusCounts) {
const count = testStatusCounts[testStatus];
if (count > 0) {
console.log(testStatus.toUpperCase(), count);
}