mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 00:50:42 +00:00
test: tighten config form element helper
This commit is contained in:
@@ -35,8 +35,8 @@ const rootSchema = {
|
||||
const rootAnalysis = analyzeConfigSchema(rootSchema);
|
||||
|
||||
function expectElement<T extends Element>(element: T | null | undefined, label: string): T {
|
||||
expect(element, label).toEqual(expect.any(Element));
|
||||
if (!element) {
|
||||
expect(element instanceof Element, label).toBe(true);
|
||||
if (!(element instanceof Element)) {
|
||||
throw new Error(`missing ${label}`);
|
||||
}
|
||||
return element;
|
||||
|
||||
Reference in New Issue
Block a user