vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
12.74k stars 1.15k forks source link

Type instantiation is excessively deep and possibly infinite. #6546

Open jasonkuhrt opened 1 week ago

jasonkuhrt commented 1 week ago

Describe the bug

There is an issue in the expectTypeOf type utility. This may be an upstream issue. If so sorry in advance.

Notice I rolled my own type equality check that passes.

CleanShot 2024-09-22 at 09 54 29@2x

CleanShot 2024-09-22 at 09 54 55@2x

Reproduction

Available at this commit jasonkuhrt/graffle@eeb4ba4 (#1107) at /src/layers/4_ResultSet/types.test-d.ts

System Info

System:
    OS: macOS 15.0
    CPU: (8) arm64 Apple M1 Pro
    Memory: 633.48 MB / 32.00 GB
    Shell: 3.5.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 22.7.0 - ~/Library/pnpm/node
    npm: 10.8.2 - ~/Library/pnpm/npm
    pnpm: 9.10.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Brave Browser: 114.1.52.122
    Chrome: 128.0.6613.139
    Safari: 18.0
  npmPackages:
    vitest: ^2.1.1 => 2.1.1

Used Package Manager

pnpm

Validations

jasonkuhrt commented 1 week ago

Right, maybe its an issue of https://github.com/mmkal/expect-type.

aryaemami59 commented 1 week ago

@jasonkuhrt Do you happen to have an actual reproduction? I can't seem to replicate it.

jasonkuhrt commented 1 week ago

Hey @aryaemami59, once I wrap this PR https://github.com/jasonkuhrt/graffle/pull/1107 (few days) I'll try to get a more minimal repro going. Thanks for your work on this!