Closed pete-seak closed 3 years ago
@pete-seak : I had the same issue. Upgrading firebase-functions-test lib to the latest version (^0.2.3) fixed it. Hope it helps !
@pete-seak : I had the same issue. Upgrading firebase-functions-test lib to the latest version (^0.2.3) fixed it. Hope it helps !
@sbenmoussati Thanks for the update. I confirm that did fix the issue
Issue copied from here
The mocked environment config for firebase appears to only be mutable on initialization. I would like to be able to modify the config for various mocha tests and test different configurations of the code. Here is an example
The config in 'Test 2' will match that of 'Test 1'. My hope was that test.cleanup() would reset the mocked state and allow it to be changed in further tests. Instead, you will see this output
I can also confirm that moving the test and functions declarations
into the individual describe blocks does nothing to control the scope. The configs are placed into global scope and are immutable after initialization.
Version info
firebase-functions-test: "firebase-functions-test": "^0.2.1" firebase-functions: "firebase-functions": "^3.11.0" firebase-admin: "firebase-admin": "^8.13.0",
Test case
Please see above
Steps to reproduce
Call
test.mockConfig
more than once (see code above)Expected behavior
value read from config is updated
Actual behavior
value read from config is the value set on the first
test.mockConfig
call