Skip to content

Commit ce8ffd6

Browse files
authored
Merge pull request #1 from leaphy-robotics/fix_playwright_issues
fix: return board from setup to allow stopping of simduino process and made ports per-page instead of global to allow multiple playwright tests to run
2 parents dd6fe90 + 4f9864f commit ce8ffd6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ declare module globalThis {
2424
reader: ReadableStreamDefaultReader<CallbackEvent>
2525
}
2626

27-
const ports: Record<string, SerialPort|null> = {}
28-
export default async function setup(page: Page) {
27+
export default async function setup(page: Page): Promise<Board> {
28+
const ports: Record<string, SerialPort|null> = {}
2929
const arduino = new Board()
3030

3131
const methods: Record<string, (...args: any[]) => Promise<any>> = {
@@ -166,4 +166,5 @@ export default async function setup(page: Page) {
166166
}
167167
})
168168

169+
return arduino;
169170
}

0 commit comments

Comments
 (0)