test-env.d.ts 785 B

123456789101112131415161718192021222324252627282930313233343536
  1. interface Chainer {
  2. then(next: Function): this
  3. thenWaitFor(n: number | Function): this
  4. end(endFn: Function): void
  5. }
  6. declare function waitForUpdate(cb: Function): Chainer
  7. declare function createTextVNode(arg?: string): any
  8. declare function triggerEvent(
  9. target: Element,
  10. event: string,
  11. process?: (e: any) => void
  12. ): void
  13. // vitest extends jest namespace so we can just extend jest.Matchers
  14. declare namespace jest {
  15. interface Matchers<R, T> {
  16. toHaveBeenWarned(): R
  17. toHaveBeenWarnedLast(): R
  18. toHaveBeenWarnedTimes(n: number): R
  19. toHaveBeenTipped(): R
  20. toHaveClass(cls: string): R
  21. }
  22. }
  23. declare const jasmine: {
  24. createSpy: (id?: string) => {
  25. (...args: any[]): any
  26. calls: {
  27. count(): number
  28. }
  29. }
  30. addMatchers(matchers: any): void
  31. }