亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Firebase 功能測試初始化??失敗

Firebase 功能測試初始化??失敗

慕容708150 2023-04-27 10:21:08
嘗試測試我的 Firebase 云功能。我已按照文檔進行操作,但在運行測試時出現以下錯誤。我嘗試生成不同的密鑰,我通過 Firebase 進入服務密鑰窗口,所以它是正確的項目。運行測試時出現錯誤:npm testError: Options object {"_fieldsProto":{"foo":{"stringValue":"bar"}},"_ref":{"_firestore":{"_settings":{"credentials":{"private_key":"KEY","client_email":"[email protected]"},"projectId":"project","firebaseVersion":"8.13.0","libName":"gccl","libVersion":"3.8.6 fire/8.13.0"},"_settingsFrozen":false,"_serializer":{"allowUndefined":false},"_projectId":"project","registeredListenersCount":0,"_lastSuccessfulRequest":0,"_backoffSettings":{"initialDelayMs":100,"maxDelayMs":60000,"backoffFactor":1.3},"_preferTransactions":false,"_clientPool":{"concurrentOperationLimit":100,"maxIdleClients":1,"activeClients":{},"terminated":false,"terminateDeferred":{"promise":{}}}},"_path":{"segments":["document","path"],"projectId":"project","databaseId":"(default)"},"_converter":{}},"_serializer":{"allowUndefined":false},"_readTime":{"_seconds":1602169684,"_nanoseconds":285000000},"_createTime":{"_seconds":1602169684,"_nanoseconds":285000000},"_updateTime":{"_seconds":1602169684,"_nanoseconds":285000000}} has invalid key "_fieldsProto"    at /home//Desktop/Work/test-app/app/functions/node_modules/firebase-functions-test/lib/main.js:99:19    at Array.forEach (<anonymous>)    at _checkOptionValidity (/home//Desktop/Work/test-app/app/functions/node_modules/firebase-functions-test/lib/main.js:97:26)    at scheduledWrapped (/home//Desktop/Work/test-app/app/functions/node_modules/firebase-functions-test/lib/main.js:36:13)    at Object.<anonymous> (/home//Desktop/Work/test-app/app/functions/index.test.js:98:1)const test = require('firebase-functions-test')({     databaseURL: "####",     storageBucket: "####",     projectId: "#####",   }, './key.json');  const myFunctions = require('./index.js'); const wrapped = test.wrap(myFunctions.testFunction);const snap = test.firestore.makeDocumentSnapshot({foo: 'bar'}, 'document/path'); wrapped(snap); test.cleanup();
查看完整描述

1 回答

?
慕斯709654

TA貢獻1840條經驗 獲得超5個贊

它說無效的鍵“_fieldProto”,如果你看看這個字典實際包含的內容:


"fieldsProto":{"foo":{"stringValue":"bar"}}

我認為您只需要刪除傳遞給包裝函數的參數即可。


const wrapped = test.wrap(myFunctions.testFunction);

wrapped(); 

test.cleanup();


查看完整回答
反對 回復 2023-04-27
  • 1 回答
  • 0 關注
  • 149 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號