question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE][VS CODE EXTENSION] Use all projects for starting the tree of tests

See original GitHub issue

Context:

  • Playwright Version: 1.25.2
  • Operating System: Mac
  • Node.js version: 16
  • Visual Studio Code version: 1.66
  • Playwright for VSCode extension version: 0.2.10 Preview
  • Browser: All
  • Extra: monorepo setup managed by TurboRepo

I imagine that there are many things planned for the Playwright extension for VS Code. But here is one suggestion.

I use a monorepo setup managed by TurboRepo. Ideally, to me, I would have Playwright working independently on each one of my packages, and the extension would detect the many files named playwright.config.ts at the root of each package.

Unfortunately, that does not seem to work with the VS extension.

Because of this, I have many projects listed in one single config file at the root of my monorepo. Each project uses a testMatch property to funnel the tests files of a single project, as such:

// Please nevermind the strings. I know they are supposed to be regexp.
projects: [
  {
    name: 'all'
    testMatch: '**/*.test.ts'
  },
  {
    name: 'client'
    testMatch: 'apps/client/**/*.test.ts'
  },
  {
    name: 'server'
    testMatch: 'apps/server/**/*.test.ts'
  },
  {
    name: 'package1'
    testMatch: 'packages/package-1/**/*.test.ts'
  },
  ...
]

But did you notice the first project named all? I do that because that is the only way to have all tests listed by the extension.

What I would like to do is to remove that project named all and have the extension listing all projects as starting points for their own tree of tests. That way, the extension would look like this (without the project named all):

> client
> server
  src/
    a.test.ts
    b.test.ts
> package1

I think this would be nice because each project has its own configuration, like outputDir and snapshotDir.

Please advise if you think this is a good approach or if I should have one config file for each project.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mxschmittcommented, Sep 12, 2022

If you are interested in contributing to the docs, you are more than welcome! The relevant file is here: https://github.com/microsoft/playwright/blob/main/docs/src/getting-started-vscode-js.md

0reactions
aslushnikovcommented, Nov 11, 2022

We’ve updated docs!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Extensions - Visual Studio Code
Visual Studio Code supports running and debugging tests for your extension. These tests will run inside a special instance of VS Code named...
Read more >
Tree View API - Visual Studio Code
The Tree View API allows extensions to show content in the sidebar in Visual Studio Code. This content is structured as a tree...
Read more >
Your First Extension - Visual Studio Code
Create your first Visual Studio Code extension (plug-in) with a simple ... The generator scaffolds a TypeScript or JavaScript project ready for development....
Read more >
vscode-jest - Visual Studio Marketplace
This extension supports full jest features in vscode environment to make testing more intuitive and fun. It should work out-of-the-box for most ...
Read more >
Web Extensions - Visual Studio Code
dev user interface reached by pressing . (the period key) when browsing a repository or Pull Request in GitHub. When VS Code is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found