vitest-dev / vitest-dev/vscode

Vitest extension doesn't run test files with tags

Open
#799 9 comments 1 reaction 2 assignees View on GitHub

@sheremet-va is already working on this.

Since Aug 1, 2026.

  • #800 by @copilot-swe-agent — closed without merging
pending triage
Dominant language
TypeScript
Stars
924
Forks
122
Avg merge
1d 14h
Merged PRs (30d)
6

Description

Describe the bug

I am using tags in my unit tests and noticed that the Vitest extension for Visual Studio Code cannot run tests that are having tags declared.

Screenshot:

Image
Expected behavior

Tests are being executed.

Reproduction

Build a test case with tags, i.e.

describe('getResultOrThrow', () => {
  it('identifies an up-trending asset by a positive ROC', {tags: ['tulipindicators']}, () => {
    // ...  
  });
});

The extension cannot run the test although the tags are defined in the vites.config.ts file:

import { defineConfig, mergeConfig } from "vitest/config";
import baseConfig from "../../vitest.config.base";

export default mergeConfig(
  baseConfig,
  defineConfig({
    test: {
      tags: [
        {
          description: "...",
          name: "tulipindicators",
        },
      ],
    },
  }),
);

My vitest.config.base.ts file looks like this:

import {defineConfig} from 'vitest/config';

export default defineConfig({
  esbuild: {
    /*
     * Allows using the "accessor" keyword in TypeScript:
     * https://github.com/vitest-dev/vitest/issues/5976#issuecomment-2190804966
     */
    target: 'es2022',
  },
  test: {
    bail: 1,
    coverage: {
      exclude: ['src/start/**'],
      include: ['src/**'],
      provider: 'v8',
      reporter: ['html', 'lcov', 'text'],
    },
    environment: 'node',
    globals: true,
    // https://main.vitest.dev/guide/learn/writing-tests-with-ai.html#mock-cleanup
    restoreMocks: true,
    sequence: {
      concurrent: true,
      shuffle: true,
    },
  },
});
Output
> Error: The Vitest config does't define any "tags", cannot apply "tulipindicators" tag for this test. See: https://vitest.dev/guide/test-tags
Extension Version

1.50.8

Vitest Version

4.1.10

Validations

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.