Skip to content
vxvx
GitHubBlueskydev.toRSS

Dev servers in the graph

A server is ready when it prints a line, not after sleep 5.

e2e tests start when the dev server prints its ready line.

End-to-end tests need the dev server up first, and most setups sleep and hope.

In vx a dev server is a persistent task. readyWhen is a pattern matched against each line it prints; when it matches, the tasks that depend on the server start. When the run ends, the server stops.

// config

// packages/web/vx.config.ts
import { defineProject } from '@vzn/vx/config'

export default defineProject({
  tasks: {
    dev: {
      exec: { command: 'vite', persistent: { readyWhen: 'Local:' } },
    },
    e2e: {
      dependsOn: ['dev'],
      exec: { command: 'playwright test' },
    },
  },
})
Turborepo, Nx and other product names are trademarks of their owners. vx is not affiliated with or endorsed by them.