MithrilJS / ospec

Noiseless testing framework
MIT License
48 stars 13 forks source link

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

Open gilbert opened 1 year ago

gilbert commented 1 year ago

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