Open
Conversation
PDIP (Plastic Dual Inline Package) is functionally identical to DIP. Added pdip as a thin wrapper that delegates to the existing dip implementation, with type definitions, exports, and tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tests/pdip.test.ts
Outdated
Comment on lines
+1
to
+28
| import { test, expect } from "bun:test" | ||
| import { convertCircuitJsonToPcbSvg } from "circuit-to-svg" | ||
| import { fp } from "../src/footprinter" | ||
| import type { AnyCircuitElement } from "circuit-json" | ||
|
|
||
| test("pdip8", () => { | ||
| const circuitJson = fp.string("pdip8").circuitJson() as AnyCircuitElement[] | ||
| const svgContent = convertCircuitJsonToPcbSvg(circuitJson) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip8") | ||
| }) | ||
|
|
||
| test("pdip8 produces same circuit json as dip8", () => { | ||
| const pdipJson = fp.string("pdip8").circuitJson() as AnyCircuitElement[] | ||
| const dipJson = fp.string("dip8").circuitJson() as AnyCircuitElement[] | ||
| expect(pdipJson).toEqual(dipJson) | ||
| }) | ||
|
|
||
| test("pdip16", () => { | ||
| const circuitJson = fp.string("pdip16").circuitJson() as AnyCircuitElement[] | ||
| const svgContent = convertCircuitJsonToPcbSvg(circuitJson) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip16") | ||
| }) | ||
|
|
||
| test("pdip8 with builder API", () => { | ||
| const circuitJson = fp().pdip(8).w(7.62).circuitJson() as AnyCircuitElement[] | ||
| const svgContent = convertCircuitJsonToPcbSvg(circuitJson) | ||
| expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip8_builder") | ||
| }) |
Contributor
There was a problem hiding this comment.
This test file violates the rule that a *.test.ts file may have AT MOST one test(...) call. The file contains 4 test() calls on lines 6, 12, 18, and 24. According to the rule, after the first test, the user should split into multiple, numbered files. This file should be split into separate files like pdip1.test.ts, pdip2.test.ts, pdip3.test.ts, and pdip4.test.ts, with each file containing only one test() call.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
Address Graphite review: split 4 test() calls into pdip.test.ts, pdip2.test.ts, pdip3.test.ts, pdip4.test.ts per repo convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
pdipfunction insrc/fn/pdip.tsthat delegates to the existingdipimplementationpdip8==dip8)Fixes #371
Test plan
pdip8string parsing produces correct circuit JSONpdip8output is identical todip8outputpdip16renders correctlyfp().pdip(8).w(7.62)) works correctly🤖 Generated with Claude Code