Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Type Check] In some special cases of describe nesting, the test flow can get stuck. #4964

Closed
6 tasks done
yingpengsha opened this issue Jan 15, 2024 · 0 comments · Fixed by #5065
Closed
6 tasks done
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@yingpengsha
Copy link
Contributor

Describe the bug

In some special cases of describe nesting, the test flow can get stuck.

Test Case

import { describe, expectTypeOf, test } from "vitest";
import { squared } from "../src/basic.js";

describe("type testing", () => {
  describe("type testing", () => {
    test("basic return type", () => {
      expectTypeOf(squared(1)).toEqualTypeOf<number>();
    });

    // Commenting this describe will not block the test
    describe("type testing", () => {
      test("basic return type", () => {
        expectTypeOf(squared(1)).toEqualTypeOf<number>();
      });
    });
  });

  // Or choosing to comment the describe won't block the test
  describe("type testing", () => {
    test("basic return type", () => {
      expectTypeOf(squared(1)).toEqualTypeOf<number>();
    });
  });
});

Console Result

Console stuck does not continue

❯ npm run test

> test
> vitest --typecheck

Testing types with tsc and vue-tsc is an experimental feature.
Breaking changes might not follow SemVer, please pin Vitest's version when using it.

 DEV  v1.2.0 /home/yingpengsha/vitest-type-check-stuck-issue-reproduction

Refs

#4921 (comment)

/cc @hi-ogawa

Reproduction

https://stackblitz.com/~/github.com/yingpengsha/vitest-type-check-stuck-issue-reproduction

System Info

stackblitz webcontainer

Used Package Manager

npm

Validations

@sheremet-va sheremet-va added bug p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Jan 15, 2024
aryaemami59 added a commit to aryaemami59/redux-toolkit that referenced this issue Jan 28, 2024
  - Resolved an issue where the type checker in Vitest hangs when handling three levels of nested `describe` blocks. vitest-dev/vitest#4964
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants