Skip to content

Commit 27792cf

Browse files
Copilotunixfox
andcommitted
Fix formatting issues in secret_key_validation_test.ts
Co-authored-by: unixfox <[email protected]>
1 parent 345417d commit 27792cf

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

src/tests/secret_key_validation_test.ts

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ Deno.test("Secret key validation in Invidious companion config", async (t) => {
3030
} catch (error) {
3131
assert(
3232
false,
33-
`Key "${key}" should be valid but config parsing failed: ${error instanceof Error ? error.message : String(error)}`,
33+
`Key "${key}" should be valid but config parsing failed: ${
34+
error instanceof Error ? error.message : String(error)
35+
}`,
3436
);
3537
}
3638
}
@@ -63,12 +65,17 @@ Deno.test("Secret key validation in Invidious companion config", async (t) => {
6365
} catch (error) {
6466
// Verify it's a config parsing error with the right message
6567
assert(
66-
error instanceof Error && error.message.includes("Failed to parse configuration"),
67-
`Should get config parsing error, got: ${error instanceof Error ? error.message : String(error)}`,
68+
error instanceof Error &&
69+
error.message.includes("Failed to parse configuration"),
70+
`Should get config parsing error, got: ${
71+
error instanceof Error ? error.message : String(error)
72+
}`,
6873
);
6974

7075
// Check that the error contains expected validation message content
71-
const errorStr = error instanceof Error ? error.toString() : String(error);
76+
const errorStr = error instanceof Error
77+
? error.toString()
78+
: String(error);
7279
assert(
7380
errorStr.includes(
7481
"SERVER_SECRET_KEY contains invalid characters",
@@ -103,12 +110,17 @@ Deno.test("Secret key validation in Invidious companion config", async (t) => {
103110
} catch (error) {
104111
// Verify it's a config parsing error
105112
assert(
106-
error instanceof Error && error.message.includes("Failed to parse configuration"),
107-
`Should get config parsing error, got: ${error instanceof Error ? error.message : String(error)}`,
113+
error instanceof Error &&
114+
error.message.includes("Failed to parse configuration"),
115+
`Should get config parsing error, got: ${
116+
error instanceof Error ? error.message : String(error)
117+
}`,
108118
);
109119

110120
// Check that the error mentions length requirement
111-
const errorStr = error instanceof Error ? error.toString() : String(error);
121+
const errorStr = error instanceof Error
122+
? error.toString()
123+
: String(error);
112124
assert(
113125
errorStr.includes("exactly 16 character") ||
114126
errorStr.includes(
@@ -128,7 +140,9 @@ Deno.test("Secret key validation in Invidious companion config", async (t) => {
128140
await parseConfig();
129141
assert(false, "Should have failed with special character key");
130142
} catch (error) {
131-
const errorStr = error instanceof Error ? error.toString() : String(error);
143+
const errorStr = error instanceof Error
144+
? error.toString()
145+
: String(error);
132146

133147
// Check that the error message contains validation details
134148
assert(
@@ -147,7 +161,9 @@ Deno.test("Secret key validation in Invidious companion config", async (t) => {
147161
await parseConfig();
148162
assert(false, "Should have failed with short key");
149163
} catch (error) {
150-
const errorStr = error instanceof Error ? error.toString() : String(error);
164+
const errorStr = error instanceof Error
165+
? error.toString()
166+
: String(error);
151167
assert(
152168
errorStr.includes("exactly 16 character") ||
153169
errorStr.includes(
@@ -172,7 +188,9 @@ Deno.test("Secret key validation in Invidious companion config", async (t) => {
172188
"Should have failed with short key containing special chars",
173189
);
174190
} catch (error) {
175-
const errorStr = error instanceof Error ? error.toString() : String(error);
191+
const errorStr = error instanceof Error
192+
? error.toString()
193+
: String(error);
176194
// Should get length error since it's checked first
177195
assert(
178196
errorStr.includes("exactly 16 character") ||
@@ -197,7 +215,9 @@ Deno.test("Secret key validation in Invidious companion config", async (t) => {
197215
"Should have failed with missing/empty SERVER_SECRET_KEY",
198216
);
199217
} catch (error) {
200-
const errorStr = error instanceof Error ? error.toString() : String(error);
218+
const errorStr = error instanceof Error
219+
? error.toString()
220+
: String(error);
201221
assert(
202222
errorStr.includes("exactly 16 character") ||
203223
errorStr.includes(

0 commit comments

Comments
 (0)