Skip to content

Commit 685445c

Browse files
committed
Remove console.log in node.test.ts
1 parent af065c8 commit 685445c

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

cli/node.test.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Deno.test("getFaviconUrl - favicon.ico and apple-touch-icon.png", async () => {
4949
});
5050

5151
const result = await getFaviconUrl("https://example.com/");
52-
console.log(result);
5352
assertEquals(result.href, "https://example.com/favicon.ico");
5453

5554
fetchMock.hardReset();
@@ -75,7 +74,6 @@ Deno.test("getFaviconUrl - svg icons only falls back to /favicon.ico", async ()
7574
});
7675

7776
const result = await getFaviconUrl("https://example.com/");
78-
console.log(result);
7977
assertEquals(result.href, "https://example.com/favicon.ico");
8078

8179
fetchMock.hardReset();
@@ -107,12 +105,12 @@ Deno.test("getFaviconUrl - falls back to /favicon.ico", async () => {
107105

108106
Deno.test("rgbTo256Color - check RGB cube", () => {
109107
const CUBE_VALUES = [0, 95, 135, 175, 215, 255];
110-
const COLORS: Array<{ r: number; g: number; b: number }> = [];
108+
const colors: Array<{ r: number; g: number; b: number }> = [];
111109

112110
for (let r = 0; r < 6; r++) {
113111
for (let g = 0; g < 6; g++) {
114112
for (let b = 0; b < 6; b++) {
115-
COLORS.push({
113+
colors.push({
116114
r: CUBE_VALUES[r],
117115
g: CUBE_VALUES[g],
118116
b: CUBE_VALUES[b],
@@ -123,35 +121,35 @@ Deno.test("rgbTo256Color - check RGB cube", () => {
123121

124122
// Expected color indices for the above colors (16-231)
125123
// RGB cube: 6x6x6 = 216 colors, indices 16-231
126-
const EXPECTED_CUBE_IDX = Array.from(
127-
{ length: COLORS.length },
124+
const expected_color_idx = Array.from(
125+
{ length: colors.length },
128126
(_, i) => 16 + i,
129127
);
130128

131-
const results = COLORS.map((COLOR) =>
132-
rgbTo256Color(COLOR.r, COLOR.g, COLOR.b)
129+
const results = colors.map((color) =>
130+
rgbTo256Color(color.r, color.g, color.b)
133131
);
134-
assertEquals(results, EXPECTED_CUBE_IDX);
132+
assertEquals(results, expected_color_idx);
135133
});
136134

137135
Deno.test("rgbTo256Color - check grayscale", () => {
138-
const GRAYSCALE = Array.from({ length: 24 }).map(
136+
const grayscale = Array.from({ length: 24 }).map(
139137
(_, idx) => ({
140138
r: 8 + idx * 10,
141139
g: 8 + idx * 10,
142140
b: 8 + idx * 10,
143141
}),
144142
);
145143

146-
const EXPECTED_GRAY_IDX = Array.from(
147-
{ length: GRAYSCALE.length },
144+
const expected_gray_idx = Array.from(
145+
{ length: grayscale.length },
148146
(_, i) => 232 + i,
149147
);
150148

151-
const results = GRAYSCALE.map((GRAY) =>
149+
const results = grayscale.map((GRAY) =>
152150
rgbTo256Color(GRAY.r, GRAY.g, GRAY.b)
153151
);
154-
assertEquals(results, EXPECTED_GRAY_IDX);
152+
assertEquals(results, expected_gray_idx);
155153
});
156154

157155
Deno.test("getAsciiArt - Darkest Letter", async () => {

0 commit comments

Comments
 (0)