
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
vitest-browser-vue
Advanced tools
Render Vue components in Vitest Browser Mode. This library follows testing-library principles and exposes only locators and utilities that encourage you to write tests that closely resemble how your Vue components are used.
Requires vitest 4.0.0 or higher.
import { render } from 'vitest-browser-vue'
import { expect, test } from 'vitest'
test('counter button increments the count', async () => {
const screen = render(Component, {
props: {
initialCount: 1,
}
})
await screen.getByRole('button', { name: 'Increment' }).click()
await expect.element(screen.getByText('Count is 2')).toBeVisible()
})
vitest-browser-vue also automatically injects render and cleanup methods on the page. Example:
// vitest.config.ts
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
// if the types are not picked up, add `vitest-browser-vue` to
// "compilerOptions.types" in your tsconfig or
// import `vitest-browser-vue` manually so TypeScript can pick it up
setupFiles: ['vitest-browser-vue'],
browser: {
// ... your config
},
},
})
import { page } from 'vitest/browser'
test('counter button increments the count', async () => {
const screen = page.render(Component, {
props: {
initialCount: 1,
}
})
screen.cleanup()
})
Unlike @testing-library/vue, vitest-browser-vue cleans up the component before the test starts instead of after, so you can see the rendered result in your UI. To avoid auto-cleanup, import the render function from vitest-browser-vue/pure.
You can change the global configuration by modifying the config export. You can import it from both vitest-browser-vue and vitest-browser-vue/pure. See documentation.
import { config } from 'vitest-browser-vue'
config.global.mocks = {
$t: text => text
}
@vue/test-utils@testing-library/vueFAQs
Render Vue components in Vitest Browser Mode
We found that vitest-browser-vue demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.