forked from tscircuit/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautorouter-min-via-dimensions.test.tsx
More file actions
51 lines (45 loc) · 1.23 KB
/
autorouter-min-via-dimensions.test.tsx
File metadata and controls
51 lines (45 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { expect, test } from "bun:test"
import { getTestFixture } from "../fixtures/get-test-fixture"
test(
"autorouter uses board min via dimensions for routed vias",
async () => {
const { circuit } = getTestFixture()
circuit.add(
<board
width="12mm"
height="12mm"
layers={2}
minViaHoleDiameter={0.25}
minViaPadDiameter={0.8}
autorouter={{
local: true,
groupMode: "subcircuit",
}}
autorouterVersion="v4"
>
<testpoint
name="TP_TOP"
footprintVariant="pad"
pcbX={0}
pcbY={4}
layer="top"
/>
<testpoint
name="TP_BOTTOM"
footprintVariant="pad"
pcbX={0}
pcbY={-4}
layer="bottom"
/>
<trace from=".TP_TOP > .pin1" to=".TP_BOTTOM > .pin1" />
</board>,
)
await circuit.renderUntilSettled()
const vias = circuit.db.pcb_via.list()
expect(vias.length).toBeGreaterThan(0)
expect(vias.every((via) => via.outer_diameter === 0.8)).toBe(true)
expect(vias.every((via) => via.hole_diameter === 0.25)).toBe(true)
expect(circuit).toMatchPcbSnapshot(import.meta.path)
},
{ timeout: 30_000 },
)