Skip to content

How to separate unit and integration test #4675

Answered by AriPerkkio
Haberkamp asked this question in Q&A
Discussion options

You must be logged in to vote

What kind of separation do you need? I would probably just specify two workspace projects and configure integration test related settings there. But this still requires glob patterns to separate tests from each other:

import { defineWorkspace } from 'vitest/config';

export default defineWorkspace([
    {
        test: {
            name: 'unit',
            include: ['**/*.unit.test.ts'],
        },
    },
    {
        test: {
            name: 'integration',
            include: ['**/*.integration.test.ts'],
            // More integration test related setup here...
        },
    },
]);

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sheremet-va
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants