Skip to content

spy.calls doesn't seem to match TypeScript definitions #60

Open
@gilbert

Description

@gilbert

Runtime looks like this and works fine:

const res = {
  end: o.spy()
}
await handler(req, res)
console.log("First call", res.end.calls[0])
//=> First call { this: <ref *1> { [omitted]  }, args: [ 'ok' ] }

However, TS complains about further usage:

image

It thinks .calls is an array of arrays:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions