(fi: FieldInfo<T>)
| 66 | }) {} |
| 67 | |
| 68 | function testFieldInfo<T>(fi: FieldInfo<T>) { |
| 69 | expect(fi).toBeInstanceOf(Object) |
| 70 | expect(fi._tag).toBe("FieldInfo") |
| 71 | expect(["text", "float", "int"]).toContain(fi.type) |
| 72 | expect(fi.rules).toBeInstanceOf(Array) |
| 73 | fi.rules.forEach((r) => { |
| 74 | expect(r).toBeInstanceOf(Function) |
| 75 | }) |
| 76 | expect(fi.metadata).toBeInstanceOf(Object) |
| 77 | expect(fi.metadata.maxLength === void 0 || typeof fi.metadata.maxLength === "number").toBeTruthy() |
| 78 | expect(fi.metadata.minLength === void 0 || typeof fi.metadata.minLength === "number").toBeTruthy() |
| 79 | expect(typeof fi.metadata.required === "boolean").toBeTruthy() |
| 80 | } |
| 81 | |
| 82 | function testUnionFieldInfo<T>(ufi: UnionFieldInfo<T[]>) { |
| 83 | expect(ufi).toBeInstanceOf(Object) |
no test coverage detected
searching dependent graphs…