andreypopp/autobind-decorator

Break sinon.spy(Component.prototype, 'method')

Open

#47 opened on May 7, 2017

View on GitHub
 (8 comments) (1 reaction) (0 assignees)JavaScript (76 forks)batch import
PR welcomehelp wanted

Repository metrics

Stars
 (1,446 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

When using '@autobind' on a component, then in tests sinon.spy(Component.prototype, 'someMethod') will yield an error:

TypeError: Attempted to wrap undefined property undefined as function
...

Sorry, currently I can't provide more detail, but I'm sure @autobind is the only variable between success/error in tests.

Contributor guide