Skip to content

Debugging a test does not run teardown function from the globalSetup file #608

@tusharf5

Description

@tusharf5

Describe the bug

When running tests from cli, the global teardown function defined in "globalSetup" file runs but when debugging from the extension, it does not.

Reproduction

// config.ts

{
    test: {
      globalSetup: ['setup.ts'],
    },
}

// setup.ts

/**
 * Global setup
 */
export default function setup() {
  console.log(`Running setup ${import.meta.dirname}`);

  return () => {
  console.log(`Running cleanup ${import.meta.dirname}`);
  };
}

define a test and debug it using the following button:

Image

Output

There are extension logs for running the setup function but no logs for cleanup

Extension Version

1.17.0

Vitest Version

3.0.9

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions