Skip to content

Commit fd81f91

Browse files
committed
revert: remove unnecessary test file TS fixes
Upstream excluded src/test from tsc (e609a28), making these fixes unnecessary. Reverting to match upstream.
1 parent 4a21df1 commit fd81f91

2 files changed

Lines changed: 10 additions & 23 deletions

File tree

frontend/src/test/config.test.ts

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ import { resolve } from "path"
99
* Helper function to parse JSONC (JSON with comments)
1010
* Strips single-line and multi-line comments before parsing
1111
*/
12-
interface TSConfig {
13-
compilerOptions: {
14-
target: string
15-
moduleResolution: string
16-
noEmit: boolean
17-
strict: boolean
18-
paths: Record<string, string[]>
19-
jsx: string
20-
}
21-
include: string[]
22-
}
23-
2412
function parseJSONC(content: string): Record<string, unknown> {
2513
// Remove single-line comments
2614
let cleaned = content.replace(/\/\/.*$/gm, "")
@@ -68,38 +56,38 @@ describe("Configuration Verification Tests", () => {
6856

6957
describe("tsconfig.json", () => {
7058
it("should have correct target set to ES2020", () => {
71-
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8")) as unknown as TSConfig
59+
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8"))
7260
expect(tsconfig.compilerOptions.target).toBe("ES2020")
7361
})
7462

7563
it("should have bundler module resolution", () => {
76-
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8")) as unknown as TSConfig
64+
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8"))
7765
expect(tsconfig.compilerOptions.moduleResolution).toBe("bundler")
7866
})
7967

8068
it("should have noEmit set to true", () => {
81-
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8")) as unknown as TSConfig
69+
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8"))
8270
expect(tsconfig.compilerOptions.noEmit).toBe(true)
8371
})
8472

8573
it("should have strict mode enabled", () => {
86-
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8")) as unknown as TSConfig
74+
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8"))
8775
expect(tsconfig.compilerOptions.strict).toBe(true)
8876
})
8977

9078
it('should have path alias "@/*" configured', () => {
91-
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8")) as unknown as TSConfig
79+
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8"))
9280
expect(tsconfig.compilerOptions.paths).toHaveProperty("@/*")
9381
expect(tsconfig.compilerOptions.paths["@/*"]).toEqual(["./src/*"])
9482
})
9583

9684
it("should have jsx set to react-jsx", () => {
97-
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8")) as unknown as TSConfig
85+
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8"))
9886
expect(tsconfig.compilerOptions.jsx).toBe("react-jsx")
9987
})
10088

10189
it("should include src directory", () => {
102-
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8")) as unknown as TSConfig
90+
const tsconfig = parseJSONC(readFileSync(resolve(__dirname, "../../tsconfig.json"), "utf-8"))
10391
expect(tsconfig.include).toContain("src")
10492
})
10593
})

frontend/src/test/property-auth-routing.test.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import { describe, it, expect, vi, afterEach } from "vitest"
1212
import * as fc from "fast-check"
1313
import { render, screen, cleanup } from "@testing-library/react"
14-
import type { User } from "oidc-client-ts"
1514
import ChatPage from "@/routes/ChatPage"
1615

1716
// Mock the useAuth hook
@@ -95,7 +94,7 @@ describe("Authentication State Routing", () => {
9594
access_token: "test-token",
9695
id_token: "test-id-token",
9796
profile: { sub: "test-user-id" },
98-
} as unknown as User,
97+
} as unknown,
9998
isLoading: false,
10099
error: undefined,
101100
token: "test-id-token",
@@ -136,7 +135,7 @@ describe("Authentication State Routing", () => {
136135
access_token: "test-token",
137136
id_token: "test-id-token",
138137
profile: { sub: "test-user-id" },
139-
} as unknown as User)
138+
} as unknown)
140139
: null,
141140
isLoading: false,
142141
error: undefined,
@@ -177,7 +176,7 @@ describe("Authentication State Routing", () => {
177176
access_token: "test-token",
178177
id_token: "test-id-token",
179178
profile: { sub: "test-user-id" },
180-
} as unknown as User,
179+
} as unknown,
181180
isLoading: false,
182181
error: undefined,
183182
token: "test-id-token",

0 commit comments

Comments
 (0)