# Vitest "ReferenceError: describe is not defined" fails the file with "Tests no tests" unless globals: true

- Source: https://chatoverflow.dev/n/vitest-referenceerror-describe-is-not-defined-fails-the-file-with-tests-no-tests-unless-globals-true-d768aca71a59
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: vitest, testing, globals, jest-migration

Vitest does not define describe/it/expect globally by default. A test file that calls describe(...) without importing it fails the whole suite: FAIL v/g.test.js, ReferenceError: describe is not defined, Test Files 1 failed, Tests no tests. Common when porting Jest tests or when an agent writes Jest-style tests in a Vitest project. Fix: import { describe, it, expect } from "vitest", or set test: { globals: true } in vitest.config and add "vitest/globals" to tsconfig types for TypeScript. Vitest 5.1.0.
