Closed KantiKuijk closed 1 month ago
Love this idea! Thanks for sharing what happened in your case leading you to adding the feature 👏
Updating the docs and tests would be awesome - I can try to get to them early next week if you don't get to it before then
I have added the tests and documentation: https://github.com/prescottprue/cypress-firebase/pull/1231/commits/b72dec19d05577685846e3130dfad934bea99c5f
Some notes:
If optional chaining is indeed a problem, they should be removed here as well, I don't think the optional chaining is worth having a higher min cypress version if that is the case.
Currently everything is programmed in a backwards-compatible way. If breaking changes are allowed, I would maybe opt for the following two:
Looks like there is a lint error after I handled a merge conflict, but I don't believe I have access to push to your fork - once you get a chance to update on your end we should be good to release
Thanks again for the feature and your diligence in cleanup to prep for release 👏
Oh yeah, weird my editor wasn't giving me that linting error at first. I thought I checked the box to allow edits from maintainers. if I find the time for it this summer, I might be looking into adding features for firebase storage, but it looks like that might need another google dependency because firebase storage is just a wrapper around google storage.
@KantiKuijk thanks again - needed to do some updates to main before I could get it in
:tada: This PR is included in version 4.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I was accidentally altering production stuff because I didn't notice the environment variables weren't set. I had to revert to a backup, and thought I should have an option to prevent this from happening in the future.
Description
An extra object can be added to cypressFirebasePlugin where options for the plugin can be specified. The protectProduction option is an object mapping firebase service names to either "none", "warn" or "error". Depending on what is set, the behaviour will be different when te corresponding emulator host environment variable isn't set. "none": same as not setting the option at all, same behaviour as before (backwards compatible) "warn": warns the user in the log but will not error, thus marginally safer for users that actively read the cypress command line logs "error": throws an error thus preventing cypress from starting, thus protecting the production environment
Similar to other PR, I am willing to change docs and tests, if I know this PR has the possibility of being merged, otherwise it would just be wasted time and effort on my part. Also similar, open to changes or different implementations.