test(shared): remove unsafe test assertions

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-12 14:22:51 +09:00
parent f05aeaa63a
commit 8b093a1115
6 changed files with 36 additions and 37 deletions
+4 -8
View File
@@ -1,6 +1,7 @@
import * as fs from "node:fs"
import * as path from "node:path"
import { log } from "../logger"
import { isRecord } from "../record-type-guard"
import { writeFileAtomically } from "../write-file-atomically"
/**
@@ -48,14 +49,9 @@ export function readAppliedMigrations(configPath: string): Set<string> {
return new Set()
}
const content = fs.readFileSync(sidecarPath, "utf-8")
const parsed = JSON.parse(content) as unknown
if (
parsed &&
typeof parsed === "object" &&
!Array.isArray(parsed) &&
Array.isArray((parsed as MigrationsSidecar).appliedMigrations)
) {
return new Set((parsed as MigrationsSidecar).appliedMigrations.filter((m): m is string => typeof m === "string"))
const parsed: unknown = JSON.parse(content)
if (isRecord(parsed) && Array.isArray(parsed.appliedMigrations)) {
return new Set(parsed.appliedMigrations.filter((migration): migration is string => typeof migration === "string"))
}
return new Set()
} catch (err) {