acvetkov / sinon-chrome

Testing chrome extensions with Node.js
ISC License
434 stars 46 forks source link

Cannot use hasListeners(), _listeners instead #98

Open jdelafon opened 4 years ago

jdelafon commented 4 years ago

I cannot use this:

import * as chromeMock from 'sinon-chrome'

chromeMock.webRequest.onBeforeRequest.hasListeners()

TypeError: chromeMock.webRequest.onBeforeRequest.hasListeners is not a function

But I can do this instead (which my IDE and myself don't like much):

import * as chromeMock from 'sinon-chrome'

chromeMock.webRequest.onBeforeRequest._listeners

[[Function ...]]

Looks like a bug to me, is it?