@@ -719,7 +719,6 @@ describe('FunctionsApiClient', () => {
719719 describe ( 'taskQueue scopes' , ( ) => {
720720 afterEach ( ( ) => {
721721 delete process . env . EXT_INSTANCE_ID ;
722- delete process . env . KIT_INSTANCE_ID ;
723722 delete process . env . FIREBASE_KIT_INSTANCE_ID ;
724723 } ) ;
725724
@@ -734,8 +733,8 @@ describe('FunctionsApiClient', () => {
734733 } ) ;
735734 } ) ;
736735
737- it ( 'should namespace function with kit- when scope is current and KIT_INSTANCE_ID is set' , ( ) => {
738- process . env . KIT_INSTANCE_ID = 'kit-inst' ;
736+ it ( 'should namespace function with kit- when scope is current and FIREBASE_KIT_INSTANCE_ID is set' , ( ) => {
737+ process . env . FIREBASE_KIT_INSTANCE_ID = 'kit-inst' ;
739738 const stub = sinon . stub ( HttpClient . prototype , 'send' ) . resolves ( utils . responseFrom ( { } , 200 ) ) ;
740739 stubs . push ( stub ) ;
741740 return apiClient . enqueue ( { } , FUNCTION_NAME , { scope : 'current' } )
@@ -801,29 +800,30 @@ describe('FunctionsApiClient', () => {
801800 } ) ;
802801 } ) ;
803802
804- it ( 'should warn with self-targeting warning and target kit directly if KIT_INSTANCE_ID matches the string' ,
805- ( ) => {
806- process . env . KIT_INSTANCE_ID = 'my-inst' ;
807- const warnStub = sinon . stub ( console , 'warn' ) ;
808- stubs . push ( warnStub ) ;
803+ it ( 'should warn with self-targeting warning and target kit directly if ' +
804+ 'FIREBASE_KIT_INSTANCE_ID matches the string' ,
805+ ( ) => {
806+ process . env . FIREBASE_KIT_INSTANCE_ID = 'my-inst' ;
807+ const warnStub = sinon . stub ( console , 'warn' ) ;
808+ stubs . push ( warnStub ) ;
809809
810- const sendStub = sinon . stub ( HttpClient . prototype , 'send' ) . resolves ( utils . responseFrom ( { } , 200 ) ) ;
811- stubs . push ( sendStub ) ;
810+ const sendStub = sinon . stub ( HttpClient . prototype , 'send' ) . resolves ( utils . responseFrom ( { } , 200 ) ) ;
811+ stubs . push ( sendStub ) ;
812812
813- const queue = new TaskQueue ( FUNCTION_NAME , apiClient , 'my-inst' ) ;
814- return queue . enqueue ( { } )
815- . then ( ( ) => {
816- expect ( sendStub ) . to . have . been . calledOnce ;
817- expect ( sendStub . firstCall . args [ 0 ] . url ) . to . contain ( '/queues/kit-my-inst-function-name/tasks' ) ;
818- expect ( warnStub ) . to . have . been . calledOnce ;
819- expect ( warnStub . firstCall . args [ 0 ] ) . to . equal (
820- 'Targeting your own extension or kit no longer requires a second parameter, ' +
813+ const queue = new TaskQueue ( FUNCTION_NAME , apiClient , 'my-inst' ) ;
814+ return queue . enqueue ( { } )
815+ . then ( ( ) => {
816+ expect ( sendStub ) . to . have . been . calledOnce ;
817+ expect ( sendStub . firstCall . args [ 0 ] . url ) . to . contain ( '/queues/kit-my-inst-function-name/tasks' ) ;
818+ expect ( warnStub ) . to . have . been . calledOnce ;
819+ expect ( warnStub . firstCall . args [ 0 ] ) . to . equal (
820+ 'Targeting your own extension or kit no longer requires a second parameter, ' +
821821 'which can have performance implications. Please change the call ' +
822822 `taskQueue('${ FUNCTION_NAME } ', 'my-inst') to taskQueue('${ FUNCTION_NAME } ') ` +
823823 `or taskQueue('${ FUNCTION_NAME } ', { scope: "current" })`
824- ) ;
825- } ) ;
826- } ) ;
824+ ) ;
825+ } ) ;
826+ } ) ;
827827
828828 it ( 'should warn with self-targeting warning and target extension directly if EXT_INSTANCE_ID matches the string' ,
829829 ( ) => {
@@ -847,7 +847,8 @@ describe('FunctionsApiClient', () => {
847847 } ) ;
848848 } ) ;
849849
850- it ( 'should warn with kit legacy warning if kit fallback succeeds and KIT_INSTANCE_ID does not match' , ( ) => {
850+ it ( 'should warn with kit legacy warning if kit fallback succeeds and ' +
851+ 'FIREBASE_KIT_INSTANCE_ID does not match' , ( ) => {
851852 const warnStub = sinon . stub ( console , 'warn' ) ;
852853 stubs . push ( warnStub ) ;
853854
0 commit comments