@@ -5,7 +5,6 @@ import { FirebaseError } from "../../error";
55import * as args from "./args" ;
66import * as backend from "./backend" ;
77import * as gcf from "../../gcp/cloudfunctions" ;
8- import * as gcfV2 from "../../gcp/cloudfunctionsv2" ;
98import * as runv2 from "../../gcp/runv2" ;
109import * as utils from "../../utils" ;
1110import * as projectConfig from "../../functions/projectConfig" ;
@@ -90,20 +89,17 @@ describe("Backend", () => {
9089
9190 describe ( "existing backend" , ( ) => {
9291 let listAllFunctions : sinon . SinonStub ;
93- let listAllFunctionsV2 : sinon . SinonStub ;
9492 let listServices : sinon . SinonStub ;
9593 let logLabeledWarning : sinon . SinonSpy ;
9694
9795 beforeEach ( ( ) => {
9896 listAllFunctions = sinon . stub ( gcf , "listAllFunctions" ) . rejects ( "Unexpected call" ) ;
99- listAllFunctionsV2 = sinon . stub ( gcfV2 , "listAllFunctions" ) . rejects ( "Unexpected v2 call" ) ;
100- listServices = sinon . stub ( runv2 , "listServices" ) . resolves ( [ ] ) ;
97+ listServices = sinon . stub ( runv2 , "listServices" ) . rejects ( "Unexpected call" ) ;
10198 logLabeledWarning = sinon . spy ( utils , "logLabeledWarning" ) ;
10299 } ) ;
103100
104101 afterEach ( ( ) => {
105102 listAllFunctions . restore ( ) ;
106- listAllFunctionsV2 . restore ( ) ;
107103 listServices . restore ( ) ;
108104 logLabeledWarning . restore ( ) ;
109105 } ) ;
@@ -162,6 +158,7 @@ describe("Backend", () => {
162158 functions : [ ] ,
163159 unreachable : [ ] ,
164160 } ) ;
161+ listServices . onFirstCall ( ) . resolves ( [ ] ) ;
165162 listServices . throws ( new FirebaseError ( "HTTP Error: 500, Internal Error" , { status : 500 } ) ) ;
166163
167164 const context = newContext ( ) ;
@@ -190,25 +187,6 @@ describe("Backend", () => {
190187 expect ( have ) . to . deep . equal ( backend . of ( { ...ENDPOINT , httpsTrigger : { } } ) ) ;
191188 } ) ;
192189
193- it ( "should read v1 functions only when user is not allowlisted for v2" , async ( ) => {
194- listAllFunctions . onFirstCall ( ) . resolves ( {
195- functions : [
196- {
197- ...HAVE_CLOUD_FUNCTION ,
198- httpsTrigger : { } ,
199- } ,
200- ] ,
201- unreachable : [ ] ,
202- } ) ;
203- listAllFunctionsV2 . throws (
204- new FirebaseError ( "HTTP Error: 404, Method not found" , { status : 404 } ) ,
205- ) ;
206-
207- const have = await backend . existingBackend ( newContext ( ) ) ;
208-
209- expect ( have ) . to . deep . equal ( backend . of ( { ...ENDPOINT , httpsTrigger : { } } ) ) ;
210- } ) ;
211-
212190 it ( "should read v2 functions when enabled" , async ( ) => {
213191 listAllFunctions . onFirstCall ( ) . resolves ( {
214192 functions : [ ] ,
0 commit comments