-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: Automatically filter out directories based on playwright config #24
Comments
While that is something we can do, I'm not sure I can see the case for actually doing so (given the overhead of running the playwright cli). Do you currently feel the need to always define I ask because Also, what does your |
Hello, first of all thanks for the insightful questions. In my workflow I use neotest-vitest and neotest-playwright. My playwright config is more or less like this and I specify my testDir. The issue is that the vitest plugin discovers test using this function, and it will mess it up and think that playwright tests are vite tests and vice versa, because test files between these two libraries might have same file extensions. So telling these plugins which folders to use (using filter_dir) seems like a solution. Any thoughts on that? |
I haven't used other neotest adapters that much so I had not previously thought about how neotest would behave in that scenario. But I can see how that would be an issue. After #26 is merged, one way to address it would be to use a different extension for each. For instance, you could use Additionally, there's always the option of using a different directory (say a |
Sure, If the project is a personal one I can follow these practices with file extension naming conventions, but unfortunately not everyone follows conventions and just name all tests (unit, e2e) ending with |
I think that depends on the type of project. When you have Playwright component testing and Vitest units in the same folder you must differentiate the Vitest and Playwright tests with by file extension otherwise Vitest and Playwright will collide:
It does not make much sense to add the file extension in this scenario tho, where the e2e tests are in a separate folder:
|
@sand4rt Replying to your comment here as I'm afraid Github will bury that thread after that PR is merged.
I haven't tried it but I it should be possible to re-use that info. When we call the playwright cli, it returns this json object which contains the entire resolved config, including I suppose we could then apply those values to our adapter. I'm not sure if the glob from Aside from that, there a couple of things that are still not clear to me:
|
@AlexandrosAlexiou has recently added PR's to both neotest-playwright and neotest-vitest that expose a new setting Can you confirm that this allows you to run both tools simultaneously without having them trip over each other? |
Yeap that's right, I had the same issue with adapters overlapping. I have configured it using the The only issue that I have now is with neotest's test summary. Basically only files within the first registered adapter will trigger the test summary unfold when opened in a buffer. |
I modified my earlier configuration for
My playwright tests are in Please document it with a realistic looking example. |
A neotest adapter can only control what it runs. A neotest adapter can not control which tests other adapters decide to run. If As far as |
More strict examples for |
Would be great if we could filter out directories based on the
testDir
directive in the playwright configuration.(docs)The text was updated successfully, but these errors were encountered: