Skip to content

Commit

Permalink
fix(spy) Fix: vi.spyOn() Compatibility with Google APIs (vitest-dev#3141
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim-Mazurok authored and LorenzoBloedow committed Dec 19, 2023
1 parent 1bb41bd commit ae321d0
Show file tree
Hide file tree
Showing 4 changed files with 556 additions and 871 deletions.
6 changes: 3 additions & 3 deletions packages/spy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export interface MockContext<TArgs, TReturns> {

type Procedure = (...args: any[]) => any

type Methods<T> = {
[K in keyof T]: T[K] extends Procedure ? K : never
}[keyof T] & (string | symbol)
type Methods<T> = keyof {
[K in keyof T as T[K] extends Procedure ? K : never]: T[K];
}
type Properties<T> = {
[K in keyof T]: T[K] extends Procedure ? never : K
}[keyof T] & (string | symbol)
Expand Down
Loading

0 comments on commit ae321d0

Please sign in to comment.