Skip to content

Type tests pass even when they should fail #2773

@lukaVarga

Description

@lukaVarga

Describe the bug

It seems like type tests do not function. TSC correctly detects type mismatch, but the test succeeds.
It seems to affect all methods - eg.

test('type', () => {
  expectTypeOf(5).toEqualTypeOf<string>();
  assertType<number>('trs');
});

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-ifsb5l?file=test/basic.test.ts

System Info

System:
    OS: macOS 13.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 6.06 GB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    npm: 8.19.3 - ~/Desktop/code/skeletonizer/node_modules/.bin/npm
    Watchman: 2022.10.31.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 109.0.5414.119
    Firefox: 97.0
    Safari: 16.2
  npmPackages:
    vitest: ^0.28.3 => 0.28.3

Used Package Manager

npm

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