Open
Conversation
Comment on lines
+5
to
+30
| test("pcb_panelization_placement_warning parses", () => { | ||
| const warning = pcb_panelization_placement_warning.parse({ | ||
| type: "pcb_panelization_placement_warning", | ||
| message: "panelized board placement has minor issues", | ||
| pcb_panel_id: "pcb_panel_1", | ||
| pcb_board_id: "pcb_board_1", | ||
| }) | ||
|
|
||
| expect(warning.pcb_panelization_placement_warning_id).toBeDefined() | ||
| expect( | ||
| warning.pcb_panelization_placement_warning_id.startsWith( | ||
| "pcb_panelization_placement_warning", | ||
| ), | ||
| ).toBe(true) | ||
| expect(warning.pcb_panel_id).toBe("pcb_panel_1") | ||
| expect(warning.pcb_board_id).toBe("pcb_board_1") | ||
| }) | ||
|
|
||
| test("any_circuit_element includes pcb_panelization_placement_warning", () => { | ||
| const parsed = any_circuit_element.parse({ | ||
| type: "pcb_panelization_placement_warning", | ||
| message: "panelized board placement has minor issues", | ||
| }) | ||
|
|
||
| expect(parsed.type).toBe("pcb_panelization_placement_warning") | ||
| }) |
Contributor
There was a problem hiding this comment.
This test file contains 2 test() functions (lines 5 and 23), but according to the style guide rule about test file structure, a *.test.ts file may have AT MOST one test(...) function. After that, the user should split into multiple numbered files. To fix this, split the tests into separate files like 'pcb_panelization_placement_warning1.test.ts' and 'pcb_panelization_placement_warning2.test.ts', with each file containing only one test() function.
Spotted by Graphite Agent (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
pcb_panelization_placement_errorso minor panelization placement issues can be represented separately from errors.any_circuit_elementunion.Description
src/pcb/pcb_panelization_placement_warning.tsthat definepcb_panelization_placement_warningwith ID,warning_type,message, and optional context fields.src/pcb/index.tsand import its type so it is included in thePcbCircuitElementunion.pcb.pcb_panelization_placement_warningin theany_circuit_elementunion insrc/any_circuit_element.tsso it can be parsed by the general parser.tests/pcb_panelization_placement_warning.test.tsto validate parsing and union membership.Testing
bun test tests/pcb_panelization_placement_warning.test.tsand it passed (2 tests, 0 failures).bunx tsc --noEmitfor a TypeScript typecheck and it completed with no type errors.Codex Task