You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However we're looking at implementing some E2E testing utilising both our server and web-app.
In particular I think we're getting a bit stuck working out a good mechanism to startup our server before the E2E tests start.
Currently when we run tests for our server we have have globalSetup file specified within our /server/vitest.config.ts which creates a fresh DB and then starts our server. Because the setup file and tests are initiated within the /server directory it correctly picks up the /server/ts.config.ts and so everything works fine.
We'd ideally like to call that same /server/tests/setup/infrastructure.ts file, however if we try and call it from outside /server (eg from within the /web-app directory) the setup file looses the correct ts.config.json reference.
I don't think this is strictly a Vitest question so much as a ts / paths / config resolution issue.
Providing a test case is a bit tricky sorry but hoping there might be some general advice 😄
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Vitest community,
We've got a monorepo (using pnpm) and I'm just wondering about whether there are any best practices for an E2E setup with VItest Browser mode?
Currently we have a setup like this which works ok for testing each of our apps independently
However we're looking at implementing some E2E testing utilising both our server and web-app.
In particular I think we're getting a bit stuck working out a good mechanism to startup our server before the E2E tests start.
Currently when we run tests for our server we have have globalSetup file specified within our
/server/vitest.config.ts
which creates a fresh DB and then starts our server. Because the setup file and tests are initiated within the/server
directory it correctly picks up the/server/ts.config.ts
and so everything works fine.We'd ideally like to call that same
/server/tests/setup/infrastructure.ts
file, however if we try and call it from outside/server
(eg from within the/web-app
directory) the setup file looses the correctts.config.json
reference.I don't think this is strictly a Vitest question so much as a ts / paths / config resolution issue.
Providing a test case is a bit tricky sorry but hoping there might be some general advice 😄
Thanks
Rowan
Beta Was this translation helpful? Give feedback.
All reactions