refactor: fix lint errors across server and client
- replace any types with explicit types in scenario file listing, import/export and mcp upload code - type test server addresses and list callbacks, drop unused vars - document why e2e export keeps the archiver import-require form - remove unused scenario files total state in the client - require clean lint in both packages in CLAUDE.md
This commit is contained in:
1 parent
35293e372b
commit
965f262c0f
9 files changed
+41
-27
No files matched your search
@@ -41,7 +41,7 @@ describe("File Controller Integration Tests", () => {
|
||||
// Clean up files directory
|
||||
try {
|
||||
await fs.rm(filesDir, { recursive: true, force: true });
|
||||
} catch (err) {
|
||||
} catch {
|
||||
// Ignore errors if directory doesn't exist
|
||||
}
|
||||
await app.close();
|
||||
@@ -151,7 +151,9 @@ describe("File Controller Integration Tests", () => {
|
||||
expect(res.body.items.length).toBeGreaterThanOrEqual(1);
|
||||
expect(res.body.total).toBeGreaterThanOrEqual(1);
|
||||
|
||||
const file = res.body.items.find((f: any) => f.name === "listed.txt");
|
||||
const file = res.body.items.find(
|
||||
(f: { id: string; name: string }) => f.name === "listed.txt",
|
||||
);
|
||||
expect(file).toBeDefined();
|
||||
expect(file.id).toBeDefined();
|
||||
expect(file.mimeType).toBe("text/plain");
|
||||
@@ -279,7 +281,9 @@ describe("File Controller Integration Tests", () => {
|
||||
expect(Array.isArray(res.body.items)).toBe(true);
|
||||
expect(res.body.total).toBeGreaterThanOrEqual(1);
|
||||
|
||||
const artifact = res.body.items.find((f: any) => f.id === savedFile.id);
|
||||
const artifact = res.body.items.find(
|
||||
(f: { id: string; name: string; size: number }) => f.id === savedFile.id,
|
||||
);
|
||||
expect(artifact).toBeDefined();
|
||||
expect(artifact.name).toBe("artifact.txt");
|
||||
expect(artifact.size).toBe(fileBuffer.length);
|
||||
@@ -417,8 +421,6 @@ describe("File Controller Integration Tests", () => {
|
||||
|
||||
describe("File cleanup", () => {
|
||||
it("removes expired files from disk and database", async () => {
|
||||
const scenario = await createScenario("cleanup-test");
|
||||
|
||||
// Upload a file with a past expiration date
|
||||
const fileBuffer = Buffer.from("to be cleaned up");
|
||||
const savedFile = await fileStorageService.saveFile(
|
||||
@@ -445,13 +447,11 @@ describe("File Controller Integration Tests", () => {
|
||||
fail("File should have been deleted");
|
||||
} catch (err) {
|
||||
// Expected: file not found
|
||||
expect((err as any).code).toBe("ENOENT");
|
||||
expect((err as NodeJS.ErrnoException).code).toBe("ENOENT");
|
||||
}
|
||||
});
|
||||
|
||||
it("does not delete files with future expiration dates", async () => {
|
||||
const scenario = await createScenario("no-cleanup-test");
|
||||
|
||||
// Upload a file with a future expiration date
|
||||
const fileBuffer = Buffer.from("should not be cleaned");
|
||||
const futureDate = new Date(Date.now() + 24 * 60 * 60 * 1000);
|
||||
@@ -475,8 +475,6 @@ describe("File Controller Integration Tests", () => {
|
||||
});
|
||||
|
||||
it("does not delete files without expiration dates", async () => {
|
||||
const scenario = await createScenario("no-expire-test");
|
||||
|
||||
// Upload a file without expiration
|
||||
const fileBuffer = Buffer.from("permanent file");
|
||||
const savedFile = await fileStorageService.saveFile(
|
||||
|
||||
Reference in new issue
Block a user