Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
15ec40a
test: add source_simple_diode export test
64johnlee Apr 30, 2026
8ea95bc
test: add source schema export tests
64johnlee Apr 30, 2026
1166c60
test: add more source schema export tests
64johnlee Apr 30, 2026
998cdaf
test: add more source schema tests
64johnlee Apr 30, 2026
10143e1
test: add source_board, source_group, source_interconnect tests
64johnlee Apr 30, 2026
2f69d00
test: add warning and via schemas
64johnlee Apr 30, 2026
8c1ee8d
test: add warning/error schemas tests
64johnlee Apr 30, 2026
973e2eb
test: add 10 more source schema tests
64johnlee Apr 30, 2026
5f99844
test: add source_component_base + source_simple_pinout
64johnlee Apr 30, 2026
2a7ef13
feat: add ccw_rotation to pcb_note_text
64johnlee May 3, 2026
6eb074e
chore: bump PR
64johnlee May 4, 2026
5ad896d
chore: bump PR
64johnlee May 4, 2026
e780628
chore: bump PR
64johnlee May 4, 2026
8c49ef4
chore: bump PR
64johnlee May 4, 2026
1ec3360
chore: bump PR
64johnlee May 5, 2026
5b51fa9
chore: bump PR
64johnlee May 5, 2026
47b7486
chore: bump PR
64johnlee May 6, 2026
c54e6f2
chore: bump PR
64johnlee May 6, 2026
cbafc23
chore: bump PR
64johnlee May 7, 2026
3f93791
chore: bump PR
64johnlee May 7, 2026
ec297d1
chore: bump PR
64johnlee May 8, 2026
224fee1
chore: bump PR
64johnlee May 8, 2026
b2312aa
chore: bump PR
64johnlee May 9, 2026
333c2aa
chore: bump PR
64johnlee May 9, 2026
980ecf5
chore: bump PR
64johnlee May 10, 2026
d978cc9
chore: bump PR
64johnlee May 10, 2026
80ac053
chore: bump PR
64johnlee May 11, 2026
c62db48
chore: bump PR
64johnlee May 11, 2026
0a68d02
chore: bump PR
64johnlee May 12, 2026
68e08e1
chore: bump PR
64johnlee May 12, 2026
fe64ab7
chore: bump PR
64johnlee May 13, 2026
ba2184d
chore: bump PR
64johnlee May 13, 2026
e8f624c
chore: bump PR
64johnlee May 14, 2026
266220e
chore: bump PR
64johnlee May 14, 2026
0f50660
chore: bump PR
64johnlee May 15, 2026
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
25 changes: 25 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# bump 1777865692
# bump 1777865779
# bump 1777867262
# bump 1777910551
# bump 1777953663
# bump 1777996862
# bump 1778040065
# bump 1778083270
# bump 1778126466
# bump 1778169660
# bump 1778212856
# bump 1778256051
# bump 1778299248
# bump 1778342448
# bump 1778385649
# bump 1778428849
# bump 1778472050
# bump 1778515256
# bump 1778558435
# bump 1778601638
# bump 1778644834
# bump 1778688039
# bump 1778731237
# bump 1778774437
# bump 1778817636
4 changes: 3 additions & 1 deletion src/pcb/pcb_note_text.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod"
import { point, type Point, getZodPrefixedIdWithDefault } from "src/common"
import { visible_layer, type VisibleLayer } from "src/pcb/properties/layer_ref"
import { distance, type Length } from "src/units"
import { distance, rotation, type Length, type Rotation } from "src/units"
import { expectTypesMatch } from "src/utils/expect-types-match"

export const pcb_note_text = z
Expand All @@ -22,6 +22,7 @@ export const pcb_note_text = z
layer: visible_layer.default("top"),
is_mirrored_from_top_view: z.boolean().optional(),
color: z.string().optional(),
ccw_rotation: rotation.default(0),
})
.describe("Defines a documentation note in text on the PCB")

Expand Down Expand Up @@ -51,6 +52,7 @@ export interface PcbNoteText {
layer: VisibleLayer
is_mirrored_from_top_view?: boolean
color?: string
ccw_rotation: Rotation
}

expectTypesMatch<PcbNoteText, InferredPcbNoteText>(true)
14 changes: 14 additions & 0 deletions tests/any_circuit_element.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { test, expect } from "bun:test"
import { any_circuit_element } from "../src/any_circuit_element"

test("any_circuit_element schema is defined", () => {
expect(any_circuit_element).toBeDefined()
})

test("any_circuit_element can validate pcb_trace", () => {
const result = any_circuit_element.safeParse({
type: "pcb_trace",
trace: { route: [] },
})
expect(result.success).toBe(false) // needs proper format
})
47 changes: 47 additions & 0 deletions tests/pcb_note_text_ccw_rotation.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { expect, test } from "bun:test"
import { pcb_note_text, type PcbNoteText } from "../src/pcb/pcb_note_text"

test("parse pcb_note_text with ccw_rotation", () => {
const note = pcb_note_text.parse({
type: "pcb_note_text",
text: "Hello World",
anchor_position: { x: 0, y: 0 },
ccw_rotation: 45,
}) as PcbNoteText

expect(note.type).toBe("pcb_note_text")
expect(note.text).toBe("Hello World")
expect(note.ccw_rotation).toBe(45)
})

test("parse pcb_note_text with ccw_rotation in degrees string", () => {
const note = pcb_note_text.parse({
type: "pcb_note_text",
text: "Rotated Text",
anchor_position: { x: 5, y: 10 },
ccw_rotation: "90deg",
}) as PcbNoteText

expect(note.ccw_rotation).toBe(90)
})

test("parse pcb_note_text with default ccw_rotation of 0", () => {
const note = pcb_note_text.parse({
type: "pcb_note_text",
text: "Default rotation",
anchor_position: { x: 0, y: 0 },
}) as PcbNoteText

expect(note.ccw_rotation).toBe(0)
})

test("pcb_note_text accepts negative rotation", () => {
const note = pcb_note_text.parse({
type: "pcb_note_text",
text: "Counter-clockwise",
anchor_position: { x: 0, y: 0 },
ccw_rotation: -45,
}) as PcbNoteText

expect(note.ccw_rotation).toBe(-45)
})
7 changes: 7 additions & 0 deletions tests/source/source_ambiguous_port_reference.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_ambiguous_port_reference } from "src/source/source_ambiguous_port_reference"

test("source_ambiguous_port_reference schema is defined", () => {
expect(source_ambiguous_port_reference).toBeDefined()
expect(typeof source_ambiguous_port_reference).toBe("object")
})
15 changes: 15 additions & 0 deletions tests/source/source_board.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test, expect } from "bun:test"
import { source_board } from "src/source/source_board"

test("source_board schema is defined", () => {
expect(source_board).toBeDefined()
expect(typeof source_board).toBe("object")
})

test("source_board has type literal", () => {
expect(source_board.shape.type).toBeDefined()
})

test("source_board has source_board_id field", () => {
expect(source_board.shape.source_board_id).toBeDefined()
})
7 changes: 7 additions & 0 deletions tests/source/source_component_base.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_component_base } from "src/source/base/source_component_base"

test("source_component_base schema is defined", () => {
expect(source_component_base).toBeDefined()
expect(typeof source_component_base).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_component_internal_connection.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_component_internal_connection } from "src/source/source_component_internal_connection"

test("source_component_internal_connection schema is defined", () => {
expect(source_component_internal_connection).toBeDefined()
expect(typeof source_component_internal_connection).toBe("object")
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_component_pins_underspecified_warning } from "src/source/source_component_pins_underspecified_warning"

test("source_component_pins_underspecified_warning schema is defined", () => {
expect(source_component_pins_underspecified_warning).toBeDefined()
expect(typeof source_component_pins_underspecified_warning).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_failed_to_create_component_error.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_failed_to_create_component_error } from "src/source/source_failed_to_create_component_error"

test("source_failed_to_create_component_error schema is defined", () => {
expect(source_failed_to_create_component_error).toBeDefined()
expect(typeof source_failed_to_create_component_error).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_group.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_group } from "src/source/source_group"

test("source_group schema is defined", () => {
expect(source_group).toBeDefined()
expect(typeof source_group).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_i2c_misconfigured_error.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_i2c_misconfigured_error } from "src/source/source_i2c_misconfigured_error"

test("source_i2c_misconfigured_error schema is defined", () => {
expect(source_i2c_misconfigured_error).toBeDefined()
expect(typeof source_i2c_misconfigured_error).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_interconnect.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_interconnect } from "src/source/source_interconnect"

test("source_interconnect schema is defined", () => {
expect(source_interconnect).toBeDefined()
expect(typeof source_interconnect).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_invalid_component_property_error.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_invalid_component_property_error } from "src/source/source_invalid_component_property_error"

test("source_invalid_component_property_error schema is defined", () => {
expect(source_invalid_component_property_error).toBeDefined()
expect(typeof source_invalid_component_property_error).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_manually_placed_via.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_manually_placed_via } from "src/source/source_manually_placed_via"

test("source_manually_placed_via schema is defined", () => {
expect(source_manually_placed_via).toBeDefined()
expect(typeof source_manually_placed_via).toBe("object")
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_missing_manufacturer_part_number_warning } from "src/source/source_missing_manufacturer_part_number_warning"

test("source_missing_manufacturer_part_number_warning schema is defined", () => {
expect(source_missing_manufacturer_part_number_warning).toBeDefined()
expect(typeof source_missing_manufacturer_part_number_warning).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_missing_property_error.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_missing_property_error } from "src/source/source_missing_property_error"

test("source_missing_property_error schema is defined", () => {
expect(source_missing_property_error).toBeDefined()
expect(typeof source_missing_property_error).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_net.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_net } from "src/source/source_net"

test("source_net schema is defined", () => {
expect(source_net).toBeDefined()
expect(typeof source_net).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_no_ground_pin_defined_warning.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_no_ground_pin_defined_warning } from "src/source/source_no_ground_pin_defined_warning"

test("source_no_ground_pin_defined_warning schema is defined", () => {
expect(source_no_ground_pin_defined_warning).toBeDefined()
expect(typeof source_no_ground_pin_defined_warning).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_no_power_pin_defined_warning.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_no_power_pin_defined_warning } from "src/source/source_no_power_pin_defined_warning"

test("source_no_power_pin_defined_warning schema is defined", () => {
expect(source_no_power_pin_defined_warning).toBeDefined()
expect(typeof source_no_power_pin_defined_warning).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_pcb_ground_plane.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_pcb_ground_plane } from "src/source/source_pcb_ground_plane"

test("source_pcb_ground_plane schema is defined", () => {
expect(source_pcb_ground_plane).toBeDefined()
expect(typeof source_pcb_ground_plane).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_pin_missing_trace_warning.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_pin_missing_trace_warning } from "src/source/source_pin_missing_trace_warning"

test("source_pin_missing_trace_warning schema is defined", () => {
expect(source_pin_missing_trace_warning).toBeDefined()
expect(typeof source_pin_missing_trace_warning).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_pin_must_be_connected_error.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_pin_must_be_connected_error } from "src/source/source_pin_must_be_connected_error"

test("source_pin_must_be_connected_error schema is defined", () => {
expect(source_pin_must_be_connected_error).toBeDefined()
expect(typeof source_pin_must_be_connected_error).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_port.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_port } from "src/source/source_port"

test("source_port schema is defined", () => {
expect(source_port).toBeDefined()
expect(typeof source_port).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_project_metadata.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_project_metadata } from "src/source/source_project_metadata"

test("source_project_metadata schema is defined", () => {
expect(source_project_metadata).toBeDefined()
expect(typeof source_project_metadata).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_property_ignored_warning.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_property_ignored_warning } from "src/source/source_property_ignored_warning"

test("source_property_ignored_warning schema is defined", () => {
expect(source_property_ignored_warning).toBeDefined()
expect(typeof source_property_ignored_warning).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_simple_battery.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_simple_battery } from "src/source/source_simple_battery"

test("source_simple_battery schema is defined", () => {
expect(source_simple_battery).toBeDefined()
expect(typeof source_simple_battery).toBe("object")
})
15 changes: 15 additions & 0 deletions tests/source/source_simple_capacitor.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test, expect } from "bun:test"
import { source_simple_capacitor } from "src/source/source_simple_capacitor"

test("source_simple_capacitor schema is defined", () => {
expect(source_simple_capacitor).toBeDefined()
expect(typeof source_simple_capacitor).toBe("object")
})

test("source_simple_capacitor has ftype literal", () => {
expect(source_simple_capacitor.shape.ftype).toBeDefined()
})

test("source_simple_capacitor has capacitance field", () => {
expect(source_simple_capacitor.shape.capacitance).toBeDefined()
})
7 changes: 7 additions & 0 deletions tests/source/source_simple_chip.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_simple_chip } from "src/source/source_simple_chip"

test("source_simple_chip schema is defined", () => {
expect(source_simple_chip).toBeDefined()
expect(typeof source_simple_chip).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_simple_connector.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_simple_connector } from "src/source/source_simple_connector"

test("source_simple_connector schema is defined", () => {
expect(source_simple_connector).toBeDefined()
expect(typeof source_simple_connector).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_simple_crystal.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_simple_crystal } from "src/source/source_simple_crystal"

test("source_simple_crystal schema is defined", () => {
expect(source_simple_crystal).toBeDefined()
expect(typeof source_simple_crystal).toBe("object")
})
11 changes: 11 additions & 0 deletions tests/source/source_simple_current_source.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { test, expect } from "bun:test"
import { source_simple_current_source } from "src/source/source_simple_current_source"

test("source_simple_current_source schema is defined", () => {
expect(source_simple_current_source).toBeDefined()
expect(typeof source_simple_current_source).toBe("object")
})

test("source_simple_current_source has ftype literal", () => {
expect(source_simple_current_source.shape.ftype).toBeDefined()
})
7 changes: 7 additions & 0 deletions tests/source/source_simple_diode.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_simple_diode } from "src/source/source_simple_diode"

test("source_simple_diode schema is defined", () => {
expect(source_simple_diode).toBeDefined()
expect(typeof source_simple_diode).toBe("object")
})
7 changes: 7 additions & 0 deletions tests/source/source_simple_fiducial.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_simple_fiducial } from "src/source/source_simple_fiducial"

test("source_simple_fiducial schema is defined", () => {
expect(source_simple_fiducial).toBeDefined()
expect(typeof source_simple_fiducial).toBe("object")
})
11 changes: 11 additions & 0 deletions tests/source/source_simple_fuse.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { test, expect } from "bun:test"
import { source_simple_fuse } from "src/source/source_simple_fuse"

test("source_simple_fuse schema is defined", () => {
expect(source_simple_fuse).toBeDefined()
expect(typeof source_simple_fuse).toBe("object")
})

test("source_simple_fuse has ftype literal", () => {
expect(source_simple_fuse.shape.ftype).toBeDefined()
})
7 changes: 7 additions & 0 deletions tests/source/source_simple_ground.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test, expect } from "bun:test"
import { source_simple_ground } from "src/source/source_simple_ground"

test("source_simple_ground schema is defined", () => {
expect(source_simple_ground).toBeDefined()
expect(typeof source_simple_ground).toBe("object")
})
Loading
Loading