l2beat/earl

expect.a(Function) type does not work for all functions

antooni opened this issue · 1 comments

Error: Type 'Function' is not assignable to type '(t: unknown) => any'

I am developing a function with given signature

async get<T>(key: string, fromJSON: (v: any) => T): Promise<T | undefined> {..}

and I get this error when running:

expect(asyncCache.get).toHaveBeenCalledExactlyWith([
  [
      'example-key'
      expect.a(Function),
  ],
])

Released as earljs@0.2.2