【发布时间】:2020-01-01 05:24:46
【问题描述】:
我目前正在尝试在本地测试我的云功能。 我找到了几种方法,但使用 firebase 模拟器和 useFunctionsEmulator() 方法似乎很棒。在https://firebase.google.com/docs/functions/local-emulator,他们没有说方法,但我在这个网址How to test `functions.https.onCall` firebase cloud functions locally?上找到了。
但是,当我运行 firebase emulator:start 和 console.log(firebase.functions().useFunctionsEmulator('http://localhost:5001') 时,它只是显示未定义。
我在原点上尝试了几个输入,但没有任何改变。互联网上关于此的信息很少,我认为那是因为这是 alpha,所以请帮助我。
【问题讨论】:
-
我有同样的问题
-
你能多展示一些你的代码吗?预计
useFunctionsEmulator返回未定义,它只是更改设置。但是,下次您调用“可调用”函数时,它应该与模拟器对话,而不是与生产环境对话。 -
这方面有什么更新吗?
标签: firebase google-cloud-functions