Is it possible to mix browser tests and Node unit tests in the same package? #5461
Unanswered
hubertgrzeskowiak
asked this question in
Q&A
Replies: 1 comment 2 replies
-
This can be done with Vitest Workspaces. I have a project using it here: https://github.com/AriPerkkio/aria-live-capture/blob/master/vitest.workspace.ts. It runs test cases in JSDOM on Node and in browser mode. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got a package that I could like to test in both unit tests and in browser based tests.
When I set
browser.enabled
totrue
in the config, then all tests will be run in a browser though. Is there a way to conditionally enable browser mode for some tests, e.g. based on a test file naming scheme (**/*.browser.test.ts
)?I know I could write two separate configs and have two separate invocations from
package.json
, but then I wouldn't get a single test report. Any way around that?Beta Was this translation helpful? Give feedback.
All reactions