Repository navigation
feat: add noSolderPaste to all SMT pad shapes - #938
Conversation
| for (const pad of smtPadShapes) { | ||
| test(`${pad.shape} accepts optional noSolderPaste independently of solder mask`, () => { | ||
| expect(smtPadProps.parse(pad).noSolderPaste).toBeUndefined() | ||
| for (const noSolderPaste of [true, false]) { | ||
| for (const coveredWithSolderMask of [true, false]) { | ||
| const rawProps: SmtPadProps = { | ||
| ...pad, | ||
| noSolderPaste, | ||
| coveredWithSolderMask, | ||
| solderPasteMargin: "0.1mm", | ||
| } | ||
| expect(smtPadProps.parse(rawProps)).toMatchObject({ | ||
| noSolderPaste, | ||
| coveredWithSolderMask, | ||
| solderPasteMargin: 0.1, | ||
| }) | ||
| } | ||
| } | ||
| }) | ||
|
|
||
| test(`${pad.shape} rejects non-boolean noSolderPaste`, () => { | ||
| for (const noSolderPaste of ["true", "false", 0, 1, null]) { | ||
| expect(smtPadProps.safeParse({ ...pad, noSolderPaste }).success).toBe( | ||
| false, | ||
| ) | ||
| } | ||
| }) | ||
| } |
There was a problem hiding this comment.
The rule states that a *.test.ts file may have AT MOST one test(...) call; after that the user should split into multiple, numbered files (e.g., smtpad1.test.ts, smtpad2.test.ts). The added for loop over smtPadShapes generates two test(...) calls per shape (6 shapes × 2 = 12 new tests), and the file already contained multiple test(...) calls before line 174. All these tests must be split into separate, numbered test files rather than accumulated in a single smtpad.test.ts.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
Adds
noSolderPaste?: booleanto the TypeScript interfaces and Zod schemas for every<smtpad>shape: rect, rotated rect, circle, pill, rotated pill, and polygon. This lets TSX authors express test/probe pads with exposed copper and no solder paste, including pads inside footprints.Related to tscircuit/core#4630.
The parser accepts only booleans, preserves explicit
true/false, and leaves omitted values undefined. The intended behavior is thattruesuppresses paste independently of solder mask settings and takes precedence oversolderPasteMargin; omission orfalsepreserves existing paste behavior. There are no aliases or migration requirements. Core still needs to consume this prop to suppresspcb_solder_pastegeneration.Includes tests for all six shapes, omitted and explicit values, coexistence with mask and margin settings, and invalid inputs. Regenerated all required documentation.
Validation:
bun test(680 passed),tsc --noEmit,biome format ., andbun run buildpassed.