Open RaymondWongCH opened 7 years ago
I think it is fine if you skip testing initalizeFirebase() function because 70-80% coverage is enough.
The problem is that most js files given in the base code contains initalizeFirebase() function in their global scope. In other words, initalizeFirebase() function must be run when testing other function within the js files. It can't be simply skipped.
Oh then we have to check whether the addition code will affect the website or not first.
Writing tests for js files of the original version of base codes, I discover that initalizeFirebase() function declared in most of js files will cause error "Firebase App named '[DEFAULT]' already exists" when running unit test. To solve this problem, I use "firebase.apps.length === 0" to check whether Firebase is initalized or not. In this case, although the error seem to be fixed, I am concerned by whether this will affect the functionality of the website. Anyone have any opinions to this issue or can think of an alternative?