-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63b06f8
commit cd5ea7a
Showing
17 changed files
with
119 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { expect, it } from "bun:test"; | ||
import { getTestFixture } from "tests/fixtures/get-test-fixture"; | ||
import { expect, it } from "bun:test" | ||
import { getTestFixture } from "tests/fixtures/get-test-fixture" | ||
|
||
it("should render a power source", async () => { | ||
const { project } = getTestFixture(); | ||
const { project } = getTestFixture() | ||
|
||
project.add( | ||
<board width="10mm" height="10mm"> | ||
<powersource name="pwr" voltage={5} schX={2} schY={3} pcbX={0} pcbY={0} /> | ||
</board> | ||
); | ||
</board>, | ||
) | ||
|
||
project.render(); | ||
expect(project.db.schematic_component.list()).toHaveLength(1); | ||
expect(project.db.schematic_port.list()).toHaveLength(2); | ||
}); | ||
project.render() | ||
expect(project.db.schematic_component.list()).toHaveLength(1) | ||
expect(project.db.schematic_port.list()).toHaveLength(2) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
], | ||
"edit_events": [], | ||
"manual_trace_hints": [] | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { expect, it } from "bun:test"; | ||
import { getTestFixture } from "tests/fixtures/get-test-fixture"; | ||
import { expect, it } from "bun:test" | ||
import { getTestFixture } from "tests/fixtures/get-test-fixture" | ||
|
||
it("should render a net alias", async () => { | ||
const { project } = getTestFixture(); | ||
const { project } = getTestFixture() | ||
|
||
project.add( | ||
<board width="10mm" height="10mm"> | ||
<netalias net="net1" schX="1mm" schY="1mm" /> | ||
</board> | ||
); | ||
</board>, | ||
) | ||
|
||
project.render(); | ||
project.render() | ||
|
||
expect(project.db.schematic_net_label.list()).toHaveLength(1); | ||
}); | ||
expect(project.db.schematic_net_label.list()).toHaveLength(1) | ||
}) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import { expect, it } from "bun:test"; | ||
import "lib/register-catalogue"; | ||
import { Board, Circuit } from "../index"; | ||
import { expect, it } from "bun:test" | ||
import "lib/register-catalogue" | ||
import { Board, Circuit } from "../index" | ||
|
||
it("should create soup with various elements", () => { | ||
const project = new Circuit(); | ||
const project = new Circuit() | ||
|
||
const board = new Board({ | ||
width: "10mm", | ||
height: "10mm", | ||
}); | ||
project.add(board); | ||
}) | ||
project.add(board) | ||
|
||
const R1 = <resistor name="R1" resistance="10k" footprint="0402" />; | ||
board.add(R1); | ||
const R1 = <resistor name="R1" resistance="10k" footprint="0402" /> | ||
board.add(R1) | ||
|
||
board.add(<led name="LED1" footprint="0402" />); | ||
board.add(<led name="LED1" footprint="0402" />) | ||
|
||
project.render(); | ||
project.render() | ||
|
||
// Let's check the db to make sure everything we expect is there | ||
|
||
expect(project.db.source_component.select(".R1")?.name).toBe("R1"); | ||
expect(project.db.source_component.select(".R1")?.name).toBe("R1") | ||
// expect(project.db.source_component.select(".LED1")?.name).toBe("LED1") | ||
|
||
expect(project.db.pcb_smtpad.list()).toHaveLength(4); | ||
expect(project.db.pcb_smtpad.list()).toHaveLength(4) | ||
|
||
// console.log("pcb_trace", project.db.pcb_trace.list()) | ||
|
||
// console.log(project.getSoup()) | ||
}); | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
"baseUrl": ".", | ||
|
||
"paths": { | ||
"lib/*": ["lib/*"], | ||
"lib/*": ["lib/*"] | ||
}, | ||
|
||
// Bundler mode | ||
|