@@ -28,12 +28,11 @@ import { mockConfig, makeChange, _makeResourceName, wrap } from '../src/main';
2828
2929describe ( 'main' , ( ) => {
3030 describe ( '#wrap' , ( ) => {
31-
3231 const constructCF = ( eventType ?: string ) => {
3332 const cloudFunction = ( input ) => input ;
3433 set ( cloudFunction , 'run' , ( data , context ) => {
35- return { data, context } ;
36- } ) ;
34+ return { data, context } ;
35+ } ) ;
3736 set ( cloudFunction , '__trigger' , {
3837 eventTrigger : {
3938 resource : 'ref/{wildcard}/nested/{anotherWildcard}' ,
@@ -53,8 +52,11 @@ describe('main', () => {
5352 const context = wrap ( constructCF ( ) ) ( 'data' ) . context ;
5453 expect ( typeof context . eventId ) . to . equal ( 'string' ) ;
5554 expect ( context . resource . service ) . to . equal ( 'service' ) ;
56- expect ( / r e f \/ w i l d c a r d [ 1 - 9 ] \/ n e s t e d \/ a n o t h e r W i l d c a r d [ 1 - 9 ] /
57- . test ( context . resource . name ) ) . to . be . true ;
55+ expect (
56+ / r e f \/ w i l d c a r d [ 1 - 9 ] \/ n e s t e d \/ a n o t h e r W i l d c a r d [ 1 - 9 ] / . test (
57+ context . resource . name
58+ )
59+ ) . to . be . true ;
5860 expect ( context . eventType ) . to . equal ( 'event' ) ;
5961 expect ( Date . parse ( context . timestamp ) ) . to . be . greaterThan ( 0 ) ;
6062 expect ( context . params ) . to . deep . equal ( { } ) ;
@@ -73,7 +75,9 @@ describe('main', () => {
7375 } ) ;
7476
7577 it ( 'should generate auth and authType for database functions' , ( ) => {
76- const context = wrap ( constructCF ( 'google.firebase.database.ref.write' ) ) ( 'data' ) . context ;
78+ const context = wrap ( constructCF ( 'google.firebase.database.ref.write' ) ) (
79+ 'data'
80+ ) . context ;
7781 expect ( context . auth ) . to . equal ( null ) ;
7882 expect ( context . authType ) . to . equal ( 'UNAUTHENTICATED' ) ;
7983 } ) ;
@@ -90,10 +94,12 @@ describe('main', () => {
9094
9195 it ( 'should throw when passed invalid options' , ( ) => {
9296 const wrapped = wrap ( constructCF ( ) ) ;
93- expect ( ( ) => wrapped ( 'data' , {
97+ expect ( ( ) =>
98+ wrapped ( 'data' , {
9499 auth : { uid : 'abc' } ,
95100 isInvalid : true ,
96- } as any ) ) . to . throw ( ) ;
101+ } as any )
102+ ) . to . throw ( ) ;
97103 } ) ;
98104
99105 it ( 'should generate the appropriate resource based on params' , ( ) => {
0 commit comments