astra/nema17-stepper-motor-controller-spring-clamp-rp2040
A 4-layer RP2040 controller board that negotiates USB‑C PD motor power and drives a NEMA17 stepper via a DRV8825, with current sensing, thermal shutdown, RGB status LED, buzzer alarm, optional AS5600 encoder, protection/filtering, and test points.
- Version
- 1.4.0
- License
- unset
- Stars
- 0
tests/common-ground.test.tsx
import { expect, test } from "bun:test";
import { Circuit } from "tscircuit";
import Rp2040MotorController from "../index.circuit";
import { assertCommonGround } from "./helpers/assertCommonGround";
test("all grounds and mounting rings share connectivity; a missing ground connection is detected", async () => {
const circuit = new Circuit({ platform: { pcbDisabled: true } });
circuit.add(<Rp2040MotorController routingDisabled />);
await circuit.renderUntilSettled();
const json = circuit.getCircuitJson();
expect(assertCommonGround(json).checkedGroundPorts).toBe(40);
expect(json.filter((e) => (e.type === "schematic_net_label" || e.type === "schematic_text") &&
e.text === "GND" && e.display_superscript)).toEqual([]);
// Removing a real ground connection must fail despite matching GND names.
const withoutTestPointGround = json.filter(e => !(e.type === "source_trace" && e.name === "TP_G"));
expect(() => assertCommonGround(withoutTestPointGround)).toThrow();
}, 60_000);