Skip to content

Commit 6f9e413

Browse files
committed
fix: type errors in courtyard tests
1 parent 99e44a6 commit 6f9e413

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/courtyard.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ test("parse courtyard from Crystal_SMD_HC49-US", async () => {
1818
expect(courtyards.length).toBeGreaterThan(0)
1919

2020
// Verify courtyard properties
21-
expect(courtyards[0].type).toBe("pcb_courtyard_rect")
22-
expect(courtyards[0].layer).toBe("top")
23-
expect(courtyards[0].stroke_width).toBe("0.05mm")
21+
const courtyard = courtyards[0] as any
22+
expect(courtyard.type).toBe("pcb_courtyard_rect")
23+
expect(courtyard.layer).toBe("top")
24+
expect(courtyard.stroke_width).toBe("0.05mm")
2425

2526
// Verify the courtyard dimensions are correct
2627
// From the kicad_mod file, courtyard is from -6.8,-2.6 to 6.8,2.6
2728
// So width should be 13.6mm, height should be 5.2mm
28-
expect(courtyards[0].width).toBe("13.6mm")
29-
expect(courtyards[0].height).toBe("5.2mm")
30-
expect(courtyards[0].center.x).toBeCloseTo(0, 1)
31-
expect(courtyards[0].center.y).toBeCloseTo(0, 1)
29+
expect(courtyard.width).toBe("13.6mm")
30+
expect(courtyard.height).toBe("5.2mm")
31+
expect(courtyard.center.x).toBeCloseTo(0, 1)
32+
expect(courtyard.center.y).toBeCloseTo(0, 1)
3233
})
3334

3435
test("parse courtyard from R_01005_0402Metric", async () => {
@@ -45,6 +46,7 @@ test("parse courtyard from R_01005_0402Metric", async () => {
4546

4647
// R_01005 has courtyards
4748
expect(courtyards.length).toBeGreaterThan(0)
48-
expect(courtyards[0].type).toBe("pcb_courtyard_rect")
49-
expect(courtyards[0].layer).toBe("top")
49+
const courtyard = courtyards[0] as any
50+
expect(courtyard.type).toBe("pcb_courtyard_rect")
51+
expect(courtyard.layer).toBe("top")
5052
})

0 commit comments

Comments
 (0)