context.invocation might not exist
dominique-pfister opened this issue ยท 6 comments
If I use the new helix-shared version, add a .with(requiredConfig, 'fstab')
in my code and run my test function, it stumbles on the following line:
helix-shared/src/config-wrapper.js
Lines 83 to 86 in 9225ecd
with a TypeError: Cannot destructure property 'transactionId' of 'context.invocation' as it is undefined.
If I add the .. || {};
alternative as in helix-universal-logger
:
everything runs fine and I get a fstab
in my context.config
. ๐ค
๐ This issue has been resolved in version 7.29.1 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
I think you'd rather need to fix your test code. as context.invocation
is a mandatory object.....
Then why did you add that alternative in helix-universal-logger
?
I also checked existing code, e.g. https://github.com/adobe/helix-content-proxy/blob/main/test/utils.js where retrofit
is mocking a context, but no invocation
is set up there, either.
Then why did you add that alternative in
helix-universal-logger
?
probably because of the same reason...i wanted the tests to work ;-)
I also checked existing code, e.g. https://github.com/adobe/helix-content-proxy/blob/main/test/utils.js where
retrofit
is mocking a context, but noinvocation
is set up there, either.
probably forgot.