如何模拟 Identity Platform Authentication 以触发 beforeCreateHandler
我有一个谷歌云函数,我在 Google Identity Platform 的 beforeCreate
触发器中运行它,如下所示:
import * as gcipCloudFunctions from "gcip-cloud-functions";
const authClient = new gcipCloudFunctions.Auth();
const beforeCreate = authClient.functions().beforeCreateHandler((user, context) => {
console.log("Hello world");
});
export default beforeCreate;
如何创建笑话测试来模拟此事件?或者如何创建测试来执行此功能?
<一href="https://cloud.google.com/identity-platform/docs/blocking-functions#:%7E:text=Creating%20a%20blocking%20function,-%20following%20steps&text=Go%20到%20the%20Identity%20Platform%20Settings%20page%20in%20the%20Cloud%20Console.&text=选择%20the%20Triggers%20tab.,and%20then%20click%20Create%20function” rel="nofollow noreferrer">阻止功能。
I have a google cloud function which I run in Google Identity Platform in the beforeCreate
trigger which looks like this:
import * as gcipCloudFunctions from "gcip-cloud-functions";
const authClient = new gcipCloudFunctions.Auth();
const beforeCreate = authClient.functions().beforeCreateHandler((user, context) => {
console.log("Hello world");
});
export default beforeCreate;
How do I go by to create jest test to mock this event? Or How can I create test to execute this function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,目前GCP还没有这样的功能。但是,您可以尝试将其作为一项功能来请求。您可以使用问题跟踪器来请求此功能。
Currently, GCP is not having such a feature as far as I know. However, you can try requesting it as a feature. You can use issue tracker to request this feature.