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:
@@ -216,20 +216,23 @@ Body content`
|
||||
agent: string
|
||||
}
|
||||
|
||||
interface FrontmatterWithExtras extends MinimalMeta {
|
||||
extra_field: string
|
||||
another_extra: { nested: string; array: string[] }
|
||||
custom_boolean: boolean
|
||||
custom_number: number
|
||||
}
|
||||
|
||||
// when
|
||||
const result = parseFrontmatter<MinimalMeta>(content)
|
||||
const result = parseFrontmatter<FrontmatterWithExtras>(content)
|
||||
|
||||
// then
|
||||
expect(result.data.description).toBe("Test command")
|
||||
expect(result.data.agent).toBe("build")
|
||||
expect(result.body).toBe("Body content")
|
||||
// @ts-expect-error - accessing extra field not in MinimalMeta
|
||||
expect(result.data.extra_field).toBe("should not fail")
|
||||
// @ts-expect-error - accessing extra field not in MinimalMeta
|
||||
expect(result.data.another_extra).toEqual({ nested: "value", array: ["item1", "item2"] })
|
||||
// @ts-expect-error - accessing extra field not in MinimalMeta
|
||||
expect(result.data.custom_boolean).toBe(true)
|
||||
// @ts-expect-error - accessing extra field not in MinimalMeta
|
||||
expect(result.data.custom_number).toBe(42)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user