ARTICLE AD BOX
I am implementing a new testing framework at work that focuses on web application testing. I read that pnpm monorepos are great for the decoupling pattern that I have previously used in C# and Java, where for my last Selenium project the C# solution structure was:
solution/ ├─ (A) Selenium framework project ├─ (B) Selenium framework self-tests project ├─ (C) Web application framework project └─ (D) Web application tests projectIn this solution:
B depends on A for unit and integration testing C depends on A for web app-specific functionality D depends on C to test the web appAnytime I need to debug code in this solution, I can easily access the flow through the other projects via breakpoints in VS Code. I have attempted to set up a similar monorepo for a TypeScript and Playwright solution using pnpm (I made a VS Code extension in TypeScript about a year ago and I'm looking forward to getting more experience), creating the "A" and "B" packages in a similar strategy, but only seem to be able to hit breakpoints in the Playwright tests themselves (in "B").
This is difficult to share since it's company code (also being at home over the weekend and trying to do research), so I will eventually share a minimal version of what I have going there, but what I'm looking for at this point is some experience and advice about:
Is this kind of cross-package debugging possible? I assume it is and that I'm missing something; as I remember it even my VSC extension had separate client and server projects / packages / sections? What is the minimum setup to have even a vanilla JS monorepo version where I can do cross-package debugging? I'm familiar enough with imports and exports; please confirm with me about how I link up the cross-package dependencies (is just the dependencies property in the package.json enough?) What additional considerations do I need for a minimum setup with TypeScript? I've had a fair bit of trouble with that, trying various versions of source mapping and nothing providing me breakpoint access to "A" Is Playwright possibly causing me problems itself? Even when I run configurations that allow me to debug in VS Code directly, rather than Playwright's test debugger, I get the same result of no access to package "A" breakpointsThank you for the consideration. I'm excited to expand my skillset and give my team something more modern to work with.
2,1783 gold badges25 silver badges33 bronze badges
Explore related questions
See similar questions with these tags.
