Vela runs tests on Vitest and includes tests for all generated code. vitest.config.ts has two projects, told apart by file name:
server—server.test.tsnext to a route,<name>.server.test.tselsewhere. HTTP requests against the running app, with a real database behind it. The tests the generators write.unit— every othersrc/**/*.test.ts. Pure functions, no servers, no test context.
The servers the server project needs start inside Vitest: the project names vela/testing as a global setup, which starts a throwaway PocketBase and the app before the first test file and stops them after the last. So every way of running Vitest works the same, and unit on its own never starts them:
$ npm test # both projects
$ npm run test:unit # vitest run --project unit
$ npm run test:server # vela test:server
$ npx vitest --watchvela test:server is vitest run --project server with vela’s defaults. The others are Vitest’s own: filters, watch mode, an editor’s test runner, --ui. npm test is the command CI should call.
Syntax
$ vela test:server