Skip to content

Commit d014028

Browse files
committed
test: type the field-builder fixtures instead of suppressing
The three bare @ts-expect-error directives hid ordinary fixture mistakes rather than asserting anything: `fixed` and `pattern` are FHIRSchemaPattern objects, not strings, and `definition` is not a member of FHIRSchemaElement at all — fhirschema drops it, and the test only ever asserted the field's type name. Build the two patterns properly and drop the `definition` line; `short` already carries the description the test is named for.
1 parent 5e022cb commit d014028

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎test/unit/typeschema/field-builder.test.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ describe("Field Builder Core Logic", async () => {
158158
it("should handle fixed values", async () => {
159159
const element: FHIRSchemaElement = {
160160
type: "code",
161-
// @ts-expect-error
162-
fixed: "fixed-value",
161+
fixed: { type: "code", value: "fixed-value" },
163162
};
164163

165164
const fhirSchema: PFS = {
@@ -178,8 +177,7 @@ describe("Field Builder Core Logic", async () => {
178177
it("should handle pattern constraints", async () => {
179178
const element: FHIRSchemaElement = {
180179
type: "string",
181-
// @ts-expect-error
182-
pattern: "\\d{3}-\\d{3}-\\d{4}",
180+
pattern: { type: "string", value: "\\d{3}-\\d{3}-\\d{4}" },
183181
};
184182

185183
const fhirSchema: PFS = {
@@ -260,8 +258,6 @@ describe("Field Builder Core Logic", async () => {
260258
const element: FHIRSchemaElement = {
261259
type: "string",
262260
short: "Short description",
263-
// @ts-expect-error
264-
definition: "Detailed definition",
265261
};
266262

267263
const fhirSchema: PFS = {

0 commit comments

Comments
 (0)