5

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.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
Vlad Blaj
  • 55
  • 3
  • Can you please provide some details regarding what you are trying to achieve? This cloud function is just to redirect the authentication pager to blocking functions? – Rajeev Tirumalasetty Feb 25 '22 at 00:57
  • Yes exactly. I would like to simulate an authentication to call this beforeCreate trigger. – Vlad Blaj Feb 25 '22 at 08:08

1 Answers1

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.