ngneat / spectator

🦊 🚀 A Powerful Tool to Simplify Your Angular Tests
https://ngneat.github.io/spectator
MIT License
2.1k stars 178 forks source link

Support AnalogJS Vitest #679

Open talgershman opened 4 weeks ago

talgershman commented 4 weeks ago

Description

Hi,

It would be great if i could setup vitest + spectator.

https://analogjs.org/docs/features/testing/vitest

Currently I am getting an error : ReferenceError: jasmine is not defined ❯ ../../../node_modules/projects/spectator/src/lib/mock.ts:76:58 ❯ installProtoMethods ../../../node_modules/projects/spectator/src/lib/mock.ts:54:19 ❯ createSpyObject ../../../node_modules/projects/spectator/src/lib/mock.ts:75:3 ❯ Object.useFactory ../../../node_modules/projects/spectator/src/lib/mock.ts:95:23 ❯ Object.factory ../../../../../packages/core/src/di/r3_injector.ts:608:32 ❯ ../../../../../packages/core/src/di/r3_injector.ts:488:35 ❯ runInInjectorProfilerContext ../../../../../packages/core/src/render3/debug/injector_profiler.ts:285:5 ❯ R3Injector.hydrate ../../../../../packages/core/src/di/r3_injector.ts:487:11 ❯ R3Injector.get ../../../../../packages/core/src/di/r3_injector.ts:341:23 ❯ R3Injector.get ../../../../../packages/core/src/di/r3_injector.ts:352:27

Proposed solution

add vitest types

Alternatives considered

none

Do you want to create a pull request?

No

Tommy228 commented 3 weeks ago

Would be very interesting now that Nx supports vitest for Angular out of the box https://github.com/nrwl/nx/pull/27311

JoramM commented 2 weeks ago

I would also like to use Angular with Vitest and Spectator. 👍