How to mock Identity Platform Authentication to trigger beforeCreateHandler

Viewed 145

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.

1 Answers

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.

Related