Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ export class NormalComponent<
source_component_id: this.source_component_id!,
subcircuit_id: subcircuit.subcircuit_id ?? undefined,
do_not_place: props.doNotPlace ?? false,
obstructs_within_bounds: props.obstructsWithinBounds ?? true,
})

const footprint = props.footprint ?? this._getImpliedFootprintString()
Expand Down
1 change: 1 addition & 0 deletions lib/components/normal-components/Chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export class Chip<PinLabels extends string = never> extends NormalComponent<
source_component_id: this.source_component_id!,
subcircuit_id: this.getSubcircuit().subcircuit_id ?? undefined,
do_not_place: props.doNotPlace ?? false,
obstructs_within_bounds: props.obstructsWithinBounds ?? true,
})

this.pcb_component_id = pcb_component.pcb_component_id
Expand Down
1 change: 1 addition & 0 deletions lib/components/normal-components/Jumper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class Jumper<PinLabels extends string = never> extends NormalComponent<
source_component_id: this.source_component_id!,
subcircuit_id: this.getSubcircuit().subcircuit_id ?? undefined,
do_not_place: props.doNotPlace ?? false,
obstructs_within_bounds: props.obstructsWithinBounds ?? true,
})

this.pcb_component_id = pcb_component.pcb_component_id
Expand Down
1 change: 1 addition & 0 deletions lib/components/normal-components/SolderJumper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export class SolderJumper<
source_component_id: this.source_component_id!,
subcircuit_id: this.getSubcircuit().subcircuit_id ?? undefined,
do_not_place: props.doNotPlace ?? false,
obstructs_within_bounds: props.obstructsWithinBounds ?? true,
})

this.pcb_component_id = pcb_component.pcb_component_id
Expand Down
1 change: 1 addition & 0 deletions lib/components/primitive-components/Via.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class Via extends PrimitiveComponent<typeof viaProps> {
rotation: 0,
source_component_id: this.source_component_id!,
subcircuit_id: subcircuit?.subcircuit_id ?? undefined,
obstructs_within_bounds: true,
})
this.pcb_component_id = pcb_component.pcb_component_id
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@tscircuit/matchpack": "^0.0.16",
"@tscircuit/math-utils": "^0.0.21",
"@tscircuit/miniflex": "^0.0.4",
"@tscircuit/props": "0.0.335",
"@tscircuit/props": "0.0.341",
"@tscircuit/schematic-autolayout": "^0.0.6",
"@tscircuit/schematic-match-adapt": "^0.0.16",
"@tscircuit/schematic-trace-solver": "^0.0.40",
Expand All @@ -54,7 +54,7 @@
"bun-match-svg": "0.0.12",
"calculate-elbow": "^0.0.12",
"chokidar-cli": "^3.0.0",
"circuit-json": "^0.0.265",
"circuit-json": "^0.0.267",
"circuit-json-to-bpc": "^0.0.13",
"circuit-json-to-connectivity-map": "^0.0.22",
"circuit-json-to-simple-3d": "^0.0.9",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test("do not place part should be skipped", async () => {
"do_not_place": true,
"height": 4.41,
"layer": "top",
"obstructs_within_bounds": true,
"pcb_component_id": "pcb_component_0",
"rotation": 0,
"source_component_id": "source_component_0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { test, expect } from "bun:test"
import { getTestFixture } from "tests/fixtures/get-test-fixture"

test("SchematicRect with traces", async () => {
if (process.env.CI) return
test.skip("SchematicRect with traces", async () => {
const { circuit } = getTestFixture()

circuit.add(
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/get-test-autorouting-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ export const getTestAutoroutingServer = ({
},
})

afterEach(() => {
server.stop()
global.servers?.push({
url: `http://localhost:${server.port}/`,
close: () => server.stop(),
})

return {
Expand Down
17 changes: 1 addition & 16 deletions tests/fixtures/get-test-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,9 @@ export const getTestFixture = ({
? getTestStaticAssetsServer().url
: undefined

const debugOutputArray: Array<{ name: string; obj: any }> = []

// Set up event listener for debug outputs
circuit.on("debug:logOutput", (event) => {
debugOutputArray.push({ name: event.name, obj: event.content })
})

afterAll(() => {
if (debugOutputArray.length > 0) {
for (const { name, obj } of debugOutputArray) {
const fileName = `debug-output/${name}.json`
console.log(`Writing debug output to ${fileName}`)
Bun.write(
fileName,
typeof obj === "string" ? obj : JSON.stringify(obj, null, 2),
)
}
}
global.debugOutputArray?.push({ name: event.name, obj: event.content })
})

return {
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/get-test-footprint-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export const getTestFootprintServer = (json: any) => {
},
})

afterEach(() => {
server.stop()
global.servers?.push({
url: `http://localhost:${server.port}/`,
close: () => server.stop(),
})

return {
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/get-test-static-assets-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export const getTestStaticAssetsServer = () => {
},
})

afterEach(() => {
server.stop()
global.servers?.push({
url: `http://localhost:${server.port}/`,
close: () => server.stop(),
})

return { url: `http://localhost:${server.port}`, close: () => server.stop() }
Expand Down
24 changes: 24 additions & 0 deletions tests/fixtures/preload-debug-output-dump.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { afterEach } from "bun:test"

declare global {
var debugOutputArray: { name: string; obj: any }[] | undefined
}

if (!global.debugOutputArray) {
global.debugOutputArray = []
}

afterEach(() => {
if (!global.debugOutputArray) return
if (global.debugOutputArray?.length > 0) {
for (const { name, obj } of global.debugOutputArray) {
const fileName = `debug-output/${name}.json`
console.log(`Writing debug output to ${fileName}`)
Bun.write(
fileName,
typeof obj === "string" ? obj : JSON.stringify(obj, null, 2),
)
}
}
global.debugOutputArray = []
})
17 changes: 17 additions & 0 deletions tests/fixtures/preload-server-cleanup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { afterEach } from "bun:test"

declare global {
var servers: { url: string; close: () => void }[] | undefined
}

if (!global.servers) {
global.servers = []
}

afterEach(() => {
if (!global.servers) return
for (const server of global.servers) {
server.close()
}
global.servers = []
})
2 changes: 2 additions & 0 deletions tests/fixtures/preload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import "bun-match-svg"
import "./extend-expect-any-svg"
import "lib/register-catalogue"
import "./preload-debug-output-dump"
import "./preload-server-cleanup"

declare module "bun:test" {
interface Matchers<T = unknown> {
Expand Down
1 change: 1 addition & 0 deletions tests/repros/repro9-platedhole-pcbX-pcbY.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ test("board with resistor being passed schX and pcbX in mm", () => {
"do_not_place": false,
"height": 2.2,
"layer": "top",
"obstructs_within_bounds": true,
"pcb_component_id": "pcb_component_0",
"rotation": 0,
"source_component_id": "source_component_0",
Expand Down
2 changes: 2 additions & 0 deletions tests/subcircuits/subcircuit-for-chip-and-jumper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ test("subcircuit-id property for chip", async () => {
"do_not_place": false,
"height": 3,
"layer": "top",
"obstructs_within_bounds": true,
"pcb_component_id": "pcb_component_0",
"rotation": 0,
"source_component_id": "source_component_0",
Expand Down Expand Up @@ -54,6 +55,7 @@ test("subcircuit-id property for jumper", async () => {
"do_not_place": false,
"height": 3,
"layer": "top",
"obstructs_within_bounds": true,
"pcb_component_id": "pcb_component_0",
"rotation": 0,
"source_component_id": "source_component_0",
Expand Down