You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.
First and foremost, thank you for writing this library. I'm currently migrating from a legacy and deprecated cookie-monster to it and wanted to ask if it is possible to add support for passing custom document or cookie object as an argument (or a config parameter) to a constructor.
It proves to be very useful for unit testing as you can pass mock cookie object and verify the component's results without the need to monkey-patch Node's global namespace. Currently I solve it with inheriting CookieStorage class and overriding the ._getCookie() and ._setCookie() methods during testing but it doesn't seem like a clean solution to me. If you are interested in implementing this feature, I can provide a pull request.
The text was updated successfully, but these errors were encountered:
imcrazytwkr
changed the title
Using custom document or cookie object on object initialization
Using custom document or cookie object on CookieStorage initialization
Jan 19, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
First and foremost, thank you for writing this library. I'm currently migrating from a legacy and deprecated cookie-monster to it and wanted to ask if it is possible to add support for passing custom
document
orcookie
object as an argument (or a config parameter) to a constructor.It proves to be very useful for unit testing as you can pass mock cookie object and verify the component's results without the need to monkey-patch Node's global namespace. Currently I solve it with inheriting CookieStorage class and overriding the
._getCookie()
and._setCookie()
methods during testing but it doesn't seem like a clean solution to me. If you are interested in implementing this feature, I can provide a pull request.The text was updated successfully, but these errors were encountered: