quickstart uppcase test failing
➜ functions git:(master) ✗ npm test
uppercase-quickstart-functions@ test /Users/jon/github/examples/functions-samples/quickstarts/uppercase/functions mocha --reporter spec
Cloud Functions makeUpperCase 1) should upper case input and write it to /uppercase addMessage ✓ should return a 303 redirect
1 passing (152ms) 1 failing
- Cloud Functions makeUpperCase should upper case input and write it to /uppercase: TypeError: Cannot read property 'database' of null at DeltaSnapshot.get [as ref] (node_modules/firebase-functions/lib/providers/database.js:136:37) at assignValue (node_modules/lodash/lodash.js:2493:28) at node_modules/lodash/lodash.js:2702:9 at arrayEach (node_modules/lodash/lodash.js:537:11) at baseClone (node_modules/lodash/lodash.js:2696:7) at node_modules/lodash/lodash.js:2702:34 at arrayEach (node_modules/lodash/lodash.js:537:11) at baseClone (node_modules/lodash/lodash.js:2696:7) at Function.cloneDeep (node_modules/lodash/lodash.js:11102:14) at node_modules/firebase-functions/lib/cloud-functions.js:32:32
npm ERR! Test failed. See above for more details.
Having the same problem.
@laurenzlong any idea?
It seems like event.data.ref is not getting stubbed properly. (Line 100 in test/test.js). It is possible that you two have a different version of sinon installed. Could you please run "npm install" inside functions-samples/quickstarts/uppercase/functions and then run the test again, and let me know if it still fails?
I was able to get the test to pass by doing
Object.defineProperty(fakeEvent, 'ref', { get: refStub })
@laurenzlong Yea tried wiping the node modules and fresh npm install and same results (had tried yarn originally). Surprised it's working for you.
Yeap, I am having the same issue as well! Using Sinon 1.17.7
Hmmm super strange.... Thanks for the suggestion @aputinski , I'll use Object.defineProperty instead.
Closed via #35