-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Description
Clear and concise description of the problem
I'd like to change the port of browser mode, in order to run multiple browser tests in a workspace (One for storybook, one for unit tests).
I tried to specify the server.port, but it's merged and gone here:
vitest/packages/browser/src/node/index.ts
Lines 58 to 61 in 11b9432
| server: { | |
| hmr: false, | |
| watch: null, | |
| }, |
It would be nice to have ability to change the port number.
Suggested solution
- Recognize
server.portin the argument ofdefineWorkspace. - Create
test.browser.serverPortoption.
Alternative
None, I guess
Additional context
For anyone want to change port now (workaround):
// Vitest doesn't recognize server.port, so we modify it using a plugin
// ref: https://github.com/vitest-dev/vitest/issues/6677
const portChangerPlugin = (port: number): Plugin => ({
name: "port-changer",
config() {
return {
server: {
port,
},
};
},
});Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable