File tree Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ FIREBASE_APP_ID=
1010FIREBASE_MEASUREMENT_ID =
1111FIREBASE_AUTH_DOMAIN =
1212FIREBASE_API_KEY =
13- GOOGLE_ANALYTICS_API_SECRET =
13+ GOOGLE_ANALYTICS_API_SECRET =
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as functions from "firebase-functions";
33import { REGION } from "../region" ;
44import { sanitizeData } from "../utils" ;
55
6+ // TODO: (b/372315689) Re-enable function once bug is fixed
67// export const storageOnDeleteTests: any = functions
78// .runWith({
89// timeoutSeconds: 540,
@@ -24,26 +25,26 @@ import { sanitizeData } from "../utils";
2425// .set(sanitizeData(context));
2526// });
2627
27- // export const storageOnFinalizeTests: any = functions
28- // .runWith({
29- // timeoutSeconds: 540,
30- // })
31- // .region(REGION)
32- // .storage.bucket()
33- // .object()
34- // .onFinalize(async (object, context) => {
35- // const testId = object.name?.split(".")[0];
36- // if (!testId) {
37- // functions.logger.error("TestId not found for storage object finalize");
38- // return;
39- // }
40- //
41- // await admin
42- // .firestore()
43- // .collection("storageOnFinalizeTests")
44- // .doc(testId)
45- // .set(sanitizeData(context));
46- // });
28+ export const storageOnFinalizeTests : any = functions
29+ . runWith ( {
30+ timeoutSeconds : 540 ,
31+ } )
32+ . region ( REGION )
33+ . storage . bucket ( )
34+ . object ( )
35+ . onFinalize ( async ( object , context ) => {
36+ const testId = object . name ?. split ( "." ) [ 0 ] ;
37+ if ( ! testId ) {
38+ functions . logger . error ( "TestId not found for storage object finalize" ) ;
39+ return ;
40+ }
41+
42+ await admin
43+ . firestore ( )
44+ . collection ( "storageOnFinalizeTests" )
45+ . doc ( testId )
46+ . set ( sanitizeData ( context ) ) ;
47+ } ) ;
4748
4849export const storageOnMetadataUpdateTests : any = functions
4950 . runWith ( {
Original file line number Diff line number Diff line change 1010 },
1111 "main": "lib/index.js",
1212 "devDependencies": {
13- "@types/node-fetch": "^2.6.1",
1413 "typescript": "^5.3.3"
1514 },
1615 "engines": {
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ describe("Firebase Storage", () => {
2929 await admin . firestore ( ) . collection ( "storageOnMetadataUpdateTests" ) . doc ( testId ) . delete ( ) ;
3030 } ) ;
3131
32- // FIXME: Re-enable after fix
33- describe . skip ( "object onFinalize trigger" , ( ) => {
32+ describe ( "object onFinalize trigger" , ( ) => {
3433 let loggedContext : admin . firestore . DocumentData | undefined ;
3534
3635 beforeAll ( async ( ) => {
@@ -78,7 +77,7 @@ describe("Firebase Storage", () => {
7877 } ) ;
7978 } ) ;
8079
81- // FIXME: Re-enable after fix
80+ // TODO: (b/372315689) Re-enable function once bug is fixed
8281 describe . skip ( "object onDelete trigger" , ( ) => {
8382 let loggedContext : admin . firestore . DocumentData | undefined ;
8483
You can’t perform that action at this time.
0 commit comments