Skip to content

Tests not in a test[s]/nuxt/ subdirectory are excluded from typechecking #34756

Description

@septatrix

Environment

Operating system Linux 6.19.10-200.fc43.x86_64
CPU AMD Ryzen 7 7840U w/ Radeon 780M Graphics (16 cores)
Node.js version v22.22.0
nuxt/cli version 3.33.1
Package manager pnpm@10.9.0
Nuxt version 4.3.1
Nitro version 2.13.1
Builder vite@7.3.1
Config compatibilityDate, devtools, fonts, future, modules, nitro, typescript
Modules @nuxt/fonts@0.13.0, vuetify-nuxt-module@0.19.5, nuxt-auth-utils@0.5.28

Reproduction

Create a test file with content const a: number = "asdf"; under tests/utils.test.ts

Describe the bug

Running pnpm nuxt typecheck succeeds, however, it should report errors. At least Type 'string' is not assignable to type 'number' and depending on config also 'a' is declared but its value is never read..

Additional context

// content of tsconfig.json
{
  // https://nuxt.com/docs/guide/concepts/typescript
  "files": [],
  "references": [
    {
      "path": "./.nuxt/tsconfig.app.json"
    },
    {
      "path": "./.nuxt/tsconfig.server.json"
    },
    {
      "path": "./.nuxt/tsconfig.shared.json"
    },
    {
      "path": "./.nuxt/tsconfig.node.json"
    }
  ]
}

Logs

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions