'How to mock Identity Platform Authentication to trigger beforeCreateHandler

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?

Blocking Functions.



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rajeev Tirumalasetty