如何模拟 Identity Platform Authentication 以触发 beforeCreateHandler

Vla*_*laj 5 unit-testing node.js google-cloud-functions ts-jest google-cloud-identity

我有一个谷歌云函数,我在谷歌身份平台的触发器中运行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;
Run Code Online (Sandbox Code Playgroud)

我如何创建笑话测试来模拟此事件?或者如何创建测试来执行此功能?

阻塞函数

小智 1

据我所知,目前GCP还没有这样的功能。但是,您可以尝试将其作为一项功能来请求。您可以使用问题跟踪器来请求此功能。