Closed dmy-leanix closed 1 day ago
Can it be related to this line in spy.ts?
const originalMockImplementation = reactive.mockImplementation.bind(null);
yeah, it's either that line in fn()
or this line in listenWhenCalled()
: https://github.com/storybookjs/storybook/blob/29b9db7cde7cfa894b17f1b8bdebe3155c4dc4df/code/lib/test/src/spy.ts#L49
We've been suffering from the latter (found through debugging/looking at the stack trace), which was introduced here: https://github.com/storybookjs/storybook/commit/6ea5bd899fbc0c82699637aeb4eac20a61de9e73#diff-7e286e50b9508a96cb4512909ee1c653b07ebd3dc930d381b7b06115975d4effR44 (same commit you linked, just a few lines lower)
I believe @kasperpeulen confirmed this appears to be a bug, and it ought to be binding an appropriate this
Describe the bug
Currently I'm trying to upgrade to Storybook 8 my Angular's app storybook with interaction tests. In some cases I have in play function the following - getting injector, finding needed service and spying on some methods:
What's wrong, service's method losts his scope to
null
, so anythis
usage will cause errors inside that methodIn Storybook 7 it was working correctly
Reproduction link
https://stackblitz.com/edit/github-ex87bm
Reproduction steps
No response
System
Additional context
No response