+
Skip to content

Vitest: TypeError: it.skip is not a function #841

Closed
@Yberion

Description

@Yberion

Please provide the environment you discovered this bug in.

Test located in apps\analog-nx\src\app\app.component.spec.ts

Which area/package is the issue in?

vite-plugin-angular

Description

It seems that https://vitest.dev/guide/filtering.html#skipping-suites-and-tests & co are not working.

Please provide the exception or error you saw

FAIL  src/app/app.component.spec.ts [ src/app/app.component.spec.ts ]
TypeError: it.skip is not a function
 ❯ src/app/app.component.spec.ts:19:8
     17|
     18|   it('should create 1', () => {
     19|     fixture.detectChanges();
       |        ^
     20|     expect(component).toBeTruthy();
     21|   });
 ❯ _ZoneDelegate.invoke ../../node_modules/zone.js/bundles/zone.umd.js:411:30
 ❯ Zone.run ../../node_modules/zone.js/bundles/zone.umd.js:165:47
 ❯ ../../packages/vite-plugin-angular/setup-vitest.ts:41:21
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

Other information

Somehow Vitest (describe, it, ...) typing isn't working on VSCode on this repro. It's working fine on my other project with pnpm.

Angular CLI: 17.0.9
Node: 20.10.0
Package Manager: npm 10.2.3
OS: win32 x64

Angular: 17.0.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.9
@angular-devkit/build-angular   17.0.9
@angular-devkit/core            17.0.9
@angular-devkit/schematics      17.0.9
@angular/cli                    17.0.9
@schematics/angular             17.0.9
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载